Geographical representation of agn files in Google Earth

I've been trying to replicate this lovely kml representation of autogen tiles, originally done by 'Vogel', (who unfortunately doesn't appear to be around much), without success :(

http://www.avsim.com/topic/365949-fsearthtiles-updated-version/?p=3366294

Does anyone have any ideas or pointers as to how to accomplish this please? I am vaguely familiar with the naming convention for autogen files having researched it, but as to how to actually perform a calculation to generate kml squares such as this is perhaps a little beyond me...

Thanks in advance for any help advice or information! Cheers K
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

I think you should be able to get close with scenProc. Take a big polygon as input and split it in the AGN grid tiles. Then you can use ExportOGR to export it as a KML file. Google Earth should be able to read this. The only thing is the names, I would have to check what they are based on. scenProc doesn't store the LOD name at the moment, but that could be a good addition.
 
Thanks Arno, the LOD name is precisely what is required so as to be able to more efficiently uniquely identify agn squares without using annotator and reviewing the time/date stamps of changed files!
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Let me check how such names are specified in the KML file and if OGR can easily write them. Then I might be able to add it to scenProc as well. Would be a cool addition.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

I had a quick look and this should work:

Code:
ImportOGR|area.shp|*|*|NOREPROJ
#
SplitGrid|AGN|*
PlacePointAtCenterPolygon|*|String;name|LODNAME|0
#
MergeGrid
#
ExportOGR|*|KML|agntiles.kml|agntiles
But, I first have to add LODNAME as special attribute name (like NEWGUID or RND360). That would then insert the correct numbers (name) for the LOD tile that polygon is in. I'll try to code that tonight.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

I have made the change, it will be in the next build tomorrow. The syntax has changed a bit. The sample below is also included in the manual btw.

Code:
CreateRectangle|Texel
#
SplitGrid|AGN|*
PlacePointAtCenterPolygon|*|String;obj|center|0
AddAttribute|FTYPE="POINT"|String;name|TILELOD
#
MergeGrid
#
ExportOGR|*|KML|grid.kml|grid
 

Attachments

Nicely done Arno thanks. I'm guessing that I can easily use SplitGrid to produce accurate LOD9 (QMID11) hydropoly tiles from a very large coastline vector files? :) Never thought of that before...
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
I did notice that for big areas the SplitGrid is sometimes slow and seems to stall. That's something I need to check, might be a bug.

Yes, you can tell SplitGrid to use other sizes than the AGN grid as well.
 
Top