Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented Oct 16, 2016

This merge adds a script than can be use to intersect features. The features
in one file are intersected with the intersection of features in another file (which
will typically contain a single feature in any case).

This new script is used as part of the driver script to create MOC basins to
intersect two new transects, MOC_34S and MOC_6S, with the MOC basin
features to create transects defining the southern boundary of each basin.

All geojson files produced by all features scripts except
split_features.py and set_group_name.py now automatically set the
groupName property of the feature collection to 'enterGroupName'.
split_features.py produces individual feature files without a
groupName property (as before).  The new script set_group_name.py
is used to set the groupName property of an existing feature file.

The driver scripts setup_MOC_basins.py and setup_ocean_basins.py
have been updated to produce fewer output files, each of which
has its own group name.
@xylar
Copy link
Collaborator Author

xylar commented Oct 16, 2016

@milenaveneziani, this is intended to address #69. It depends on #74, so should not be merged until that PR has been fulfilled. But it could be helpful to know if this is working the way you need it to before #74 gets merged (assuming that might take a little time).

@xylar
Copy link
Collaborator Author

xylar commented Oct 16, 2016

Testing

I viewed MOCSounthernBoundaries.geojson, which is now one of the results of setup_MOC_basins.py, and verified that it contains 4 features defining the southern boundaries of each of the 4 MOC basins.

I have not preformed any other testing of intersect_features.py so far.

xylar added 3 commits October 16, 2016 19:34
The new script, intersect_features.py can be used to find features
that are the intersection of a set of features and the intersection
of a set of intersection features.
These southern boundaries are computed using the new
intersect_features.py script using MOC_34S and MOC_6S transect
features.
@milenaveneziani
Copy link
Collaborator

@xylar: I created MOCSounthernBoundaries.geojson using this code, and then ran it through the mask creator tool.
I received this error message at the end:

Built 714237 edges.
Building closest edge location for line segments
Reading edge graph
Building edge transects
Building edge transect path signs
ERROR: Edges 580335 and 298234 don't share any vertices. Exiting...

@xylar
Copy link
Collaborator Author

xylar commented Oct 18, 2016

@milenaveneziani, thanks for trying this out. I'll have to investigate further. I don't know much about how the mask creator works so it's hard for me to guess what the problem might be. Feel free to dig into the code yourself if you have the time and/or c++ expertise to do so.

@xylar
Copy link
Collaborator Author

xylar commented Oct 21, 2016

@milenaveneziani, I don't think the southern boundary as defined in this PR is what is needed for the MOC computation. Instead, I think what is actually needed is the following:

  1. Small polygons should be removed from each MOC basin. These arise because a bit of the amazon is still in the Atlantic basin, a bit of the Tasman Sea is still in the Indopacific basin, etc. These small polygons have no connection to the southern boundary of the main basin.
  2. Once small polygons are removed, the southern boundary should consist of all points on the perimeter of the polygon(s) defining the MOC basin that lie between the west-most point at the southern-most latitude in the basin and the eastern-most point at the southern-most latitude. For example, for the Atlantic MOC basin, the southern-most latitude is -34 degrees so we find the western-most and eastern-most points at this latitude, and define the southern boundary as the part of the perimeter of the the Atlantic MOC basin that connects these two.

Both of these steps will require tools that are more sophisticated than the basic manipulation tools currently available in this repo. It is not yet clear to me if the tool should be included directly in setup_ocean_basins.py or if it should be a standalone module.

@xylar
Copy link
Collaborator Author

xylar commented Oct 22, 2016

#78 replaces this PR.

@xylar xylar closed this Oct 22, 2016
@xylar xylar deleted the add_intersect_features_script branch June 23, 2021 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants