bcgov / designatedlands

Python script to combine conservation related spatial data from many sources to create a single 'Designated Lands' layer for British Columbia
Apache License 2.0
9 stars 4 forks source link

sorting by hierarchy, but as interger #15

Closed smnorris closed 7 years ago

smnorris commented 7 years ago

Rather than iterate through the source csv file, the script now sorts layers by hierarchy - just to be sure things are nicely ordered.

But the result from the sort is currently 1, 11 etc.

smnorris commented 7 years ago

Fixed in 55dcbfd

ateucher commented 7 years ago

Does the hierarchy matter in the end product? Are all layers within a rollup group not just merged?

smnorris commented 7 years ago

No, we have just dissolved/merged to the alias / input layer level. I haven't actually added that column to the output in the script, it is a last step.

ateucher commented 7 years ago

Ok. Are overlaps between layers removed at this point?

smnorris commented 7 years ago

Should be, that is definitely the goal. Area checks of output are needed though.

ateucher commented 7 years ago

Awesome. If that's dealt with then dissolving on the rollup group should be trivial.

smnorris commented 7 years ago

Currently, great_bear_fisheries_watersheds is lower priority thangreat_bear_ebm_area.

This doesn't make much sense as is, since the EBM area covers all of the watersheds, adding the watersheds at the end would have no effect.

@ateucher : Based on your comment above, it sounds like this is moot - the input categories don't matter, only the rollup categories are required?

ateucher commented 7 years ago

Yes, we didn't actually sort the designations within a category, just assigned them to a category (actually ranking every designation is really difficult). Sorry that wasn't clear to begin with

smnorris commented 7 years ago

Ok, that is slightly different from the previous resource_report job.

With only 4 categories I wouldn't bother overlaying each of the source layers individually. Instead, you can insert all records for a given category into a table and merge them with ST_Union, then overlay the resulting category tables. It might not be any faster to process but because things get merged together into only 4 layers for calculating ST_Difference there are less opportunities for Topology errors.

Anyway, it should works as is.

ateucher commented 7 years ago

Thanks @smnorris - It's not wasted effort to overlay them individually. If we go down the road of individually ranking them, the framework is there.