- Messages
- 58
- Country

Dear Arno,
I've been trying for a while to create a cultivation file for Switzerland, with differents sets of buildings depending on the regions (cultivation is AFS2's equivalent for Autogen, works similar).
I'm working with OSM data from Geofabrik.de (switzerland-latest.osm, 5.5 GB)
I first defined several sets of KML polygons for regions as follows :

Note: The part of the country without regional KML (Mainland & Jura range) will be simply assigned a base set of buildings.
Then, I made 1 SPC setup for each region, i.e. 5 SPC files, each based on the same steps, but dedicated to a specific region :
1) load the osm data, limited to interesting features:
2) load the polygons with steps like
Additionally, I also load exclusion polygons for aerodromes or whatever
3) SplitGrid
4) Add a default attribute to every building
5) Add a specific attribute to buildings belonging to the region
6) Create buildings with proper attribute
7) Export as TOC file
The steps work, but I have troubles with the AddAttributeIfInside step and my polygons.
Below are displayed the resulting non-empty cultivation tiles for each region, it clearly shows that some tiles that should be excluded were generated, while some other tiles that should belong to the region were excluded :
The Alpine range from my SPC example above:

Eastern range

Northern Alpine range

Southern Alpine range

Mainland + Jura

How does the AddAttributeIfInside step computes if inside a polygon, are there limitations, like the need for convex-only polygons? Or is there a limit in the number of vertices for a polygon? Or should I use something different for regional polygons?
Note : The AddAttributeIfInside step works nicely for my aerodrome excludes, as far as I could see.
Attached are my ScenProc settings and the resulting log files
I tried several other methods, like first unloading features that don't belong to the region, but since the filter itself fails, it unloads undue data and leave other data that should be removed.
Thank you in advance for your support, I really love ScenProc
Cheers
Antoine
I've been trying for a while to create a cultivation file for Switzerland, with differents sets of buildings depending on the regions (cultivation is AFS2's equivalent for Autogen, works similar).
I'm working with OSM data from Geofabrik.de (switzerland-latest.osm, 5.5 GB)
I first defined several sets of KML polygons for regions as follows :

Note: The part of the country without regional KML (Mainland & Jura range) will be simply assigned a base set of buildings.
Then, I made 1 SPC setup for each region, i.e. 5 SPC files, each based on the same steps, but dedicated to a specific region :
1) load the osm data, limited to interesting features:
Code:
ImportOGR|K:\XXX\switzerland-latest.osm|*|building;highway;aeroway;man_made|NOREPROJ
Code:
ImportOGR|K:\XXX\zone_Alpes_N_High.kml|*|*|NOREPROJ
3) SplitGrid
Code:
SplitGrid|0.4;0.2|5.6;10.5;45.8;48|building="*"
Code:
AddAttribute|building="*" |String;inboundary|no
Code:
AddAttributeIfInside|building="*"|FROMFILE="zone_Alpes_N_High.kml"|String;inboundary|yes
Code:
CreateAF2Building|building="*" And inboundary="yes" And...
Code:
ExportTOC|K:\XXX|cultivation_Alpes_Nord_High
The steps work, but I have troubles with the AddAttributeIfInside step and my polygons.
Below are displayed the resulting non-empty cultivation tiles for each region, it clearly shows that some tiles that should be excluded were generated, while some other tiles that should belong to the region were excluded :
The Alpine range from my SPC example above:

Eastern range

Northern Alpine range

Southern Alpine range

Mainland + Jura

How does the AddAttributeIfInside step computes if inside a polygon, are there limitations, like the need for convex-only polygons? Or is there a limit in the number of vertices for a polygon? Or should I use something different for regional polygons?
Note : The AddAttributeIfInside step works nicely for my aerodrome excludes, as far as I could see.
Attached are my ScenProc settings and the resulting log files
I tried several other methods, like first unloading features that don't belong to the region, but since the filter itself fails, it unloads undue data and leave other data that should be removed.
Thank you in advance for your support, I really love ScenProc
Cheers
Antoine





