Sign in to follow this  
Guest luissa

Excluding autogen with Shp2Vec

Recommended Posts

This is not some simple how-to, sorry. The concepts are new for most of us, so what follows is long, and will require some thought in order to understand. However, it is not difficult, once everything is integrated. And that is why it is long, in order to provide you with more detail than is found in the S.D.K. and so allow you a better understanding of it.Contents- QMID grid- shapefiles- GUID- Shp2Vec- How to create a shapefile---- Using SBuilder---- Using fGis- Other vector creation programs QMID gridFS X now makes reference to the Quad Mesh Identifier, a grid that determines the bounds of the different terrain elements. If you know the old LOD grid, then you can easily make the transition to QMID - just add 2 to LOD to get QMID. That is, LOD 13 (Area) is quad 15, LOD 5 (Cell) is quad 7.This last example is particularly important because default terrain is now contained within a quad 7 file, the cvx#### that are found in the scenery folders.To view the qmid grid, launch TMFViewer. As mentioned in the S.D.K., it is quite easy to find the quad i.d. for your project. Just load one of the image_globe#.bgl files that cover 90

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Bravo! Well done!Coverage of other vector types should be a logical extension of this information.And FYI - Shp2Vec will tolerate either ordering of vertices within a polygon ring.Please cross-post at www.fsdeveloper.com.-Doug

Share this post


Link to post
Share on other sites

Hello Everybody ,Thank you Luis for this tutorial, just some information, in complement, about this excellent tool FSX KML by Innova Software :http://www.fsdeveloper.com/wiki/index.php?title=FSX_KMLMany thanks to the Author, see also :http://forums.avsim.net/dcboard.php?az=sho...32295&mode=fullYou need also the last Google Earth Beta_4.0.2416 (freeware) which allows polygon and path creation capabilities.In Google Earth, you just draw your polygons and you can even customize colors... in the example below ( near Granville in Normandy / France ) I put white for Autogen Exclude, Green for Airport Background, Brown for rocks, Yellow for beach etc... :http://pascal.dumat.free.fr/photos/kml1.jpgeach polygon must be saved to KML format in Google Earth , then imported into FSX KML.(note that you can edit later your poly in google Earth with the tab "properties").In FSX KML, you "Add" each file and notify type or class for each poly in the "description" tab :http://pascal.dumat.free.fr/photos/kml2.jpgLast, the "Build" button let you compile your file in the new cvx format.(note than you can access to resulting dbf , shp , xml source files).Here, the result within Fs :http://pascal.dumat.free.fr/photos/kml3.jpgI think this is may be less accurate than the method you describe above with SBuilder and BLN2SHP (tested also) but easier to familiarize with this new format, at least for people who can use Google Earth.Hope this helps , best regards pascalhttp://perso.wanadoo.fr/p.dumat/htm/menu.htm

Share this post


Link to post
Share on other sites

Thanks a lot for your effort, Luis :-)I hope I get some time over this weekend to a try to use Shp2Vec.Ulf B

Share this post


Link to post
Share on other sites

> you will need his BLN2SHP - either ask him, or mention it here and you will get it.Luis, I just came across this thread and it has some great information. Many thanks!BLN2SHP looks like the perfect answer to a question in my other thread. Is it possible to get a copy?Many thanks.Best regards, Chris

Share this post


Link to post
Share on other sites

Thanks Luis -- Qs and comments1. I don't understand what the "texture" tag in the xml is for. All the vector types seem to use the same GUID for this. Is this the intent? Also should the same UUID value be used as shown in that table for the vector type attribute tag?2. Need to get "official" BLN2SHP. I found a copy from somewhere, but it wasn't from Jim. It came with another tool BLNMarker. I have no idea what this is. I saw that BLN2SHP needed shapelib.dll. I found a version 1.2.9 of that, but don't know if there is a specific version expected.3. Couldn't find any documentation on including a "z" coordinate in BLN, but apparently at least BLN2SHP can handle this. It appears that comma (,) is the only permitted delimiter in the BLNs.4. Has anyone determined if it is posible to "unflatten" a default flattern?5. FSK_KML tool is coming along. It should be noted that there are various tools which can export a KML file for use by this tool, not just Google Earth. FSX_KML inserts UUIDs and GUIDs into the dbf file for you.6. For Hydro_polys, need to know the relationship between the XML file SlopeX and SlopeY attributes and the elevations in the shapefile.7. This exclude autogen example provides precise control of the exclusion, but for general exclusions, the polygon bounding box (found in the shapefile record header for each poly)which gives minX, minY, maxX, maxY values is used.8. Not only "should" shapefile contain only 1 type of shape, but per the spec, it "must". Though it appears it would be possible to read various shape types out of a single file, there is no requirement for software to be able to do this.scott s..

Share this post


Link to post
Share on other sites

Hello Scott,The texture flag in the xml defines the attribute block - it is not the texture itself, but just tells shp2vec to expect a texture definition, I imagine. The developers would have to be the ones to give a technical explanantion of this. I wouldn't dare for fear of being shouted at.The version of the shapelib.dll that Jim included does not seem to have a version that I can find. Maybe this information is hidden in the resources.To put the elevation value in the bln, simply add a comma, and the elevation in metres, for example:21,0-62.8405616143641,17.9049018297125,3-62.8405595003106,17.9044590943,3-62.8427041476847,17.9044213750783,3-62.842709204644,17.9037198867089,3......To "unflatten" a default flatten, we must exclude it. This requires an EXX that uses the necessary GUID in its dbf. I removed the default flatten at St. Barts by specifying {46BFB3BD-CE68-418E-8112-FEBA17428ACE}that is the GUID for 164 Flatten MaskClassMap ExcludeAutoGen and this pretty much removed everything, the grass, the flatten, and the autogen exclude. Then, I had to go back and create everything over again.The slopex and slopey in the dbf confused me a lot at first. They are not the same as the elevation of the shape in the shapefile. Shapefile elevation is a z-coordinate that is contained within the shapefile itself.The slopex and slopey fields in the dbf tell shp2vec how to apply a slope - the values should be vertical slope in meters per degree, and have fun figuring that out. I prefer to use the mesh-clinging water, myself.Well, we are all still feeling our way about this. Thanks for the comments, very interesting.Best regards.Luis

Share this post


Link to post
Share on other sites

Luis is correct, you can exclude the default flatten with an exclusion polygon and add you new flatten in the same cvx file. Here is an example at EGCC. The inner yellow polygon is the default flatten, the cyan polygon is the exclusion and the outer yellow polygon is the new flatten.Georgeexclusionsq0.jpgimageshack.png

Share this post


Link to post
Share on other sites

>The texture flag in the xml defines the attribute block - it>is not the texture itself, but just tells shp2vec to expect a>texture definition, I imagine. The developers would have to be>the ones to give a technical explanantion of this. I wouldn't>dare for fear of being shouted at.Yup. Note that "texture definition" is a loose term.>The slopex and slopey in the dbf confused me a lot at first.>They are not the same as the elevation of the shape in the>shapefile. >>Shapefile elevation is a z-coordinate that is contained within>the shapefile itself.>>The slopex and slopey fields in the dbf tell shp2vec how to>apply a slope - the values should be vertical slope in meters>per degree, and have fun figuring that out. I prefer to use>the mesh-clinging water, myself.The slope values are not used by Shp2Vec itself. It is just pre-computed data (to save time at runtime) that Shp2Vec passes through to the game.-Doug

Share this post


Link to post
Share on other sites

>Luis is correct, you can exclude the default flatten with an>exclusion polygon and add you new flatten in the same cvx>file. Here is an example at EGCC. The inner yellow polygon is>the default flatten, the cyan polygon is the exclusion and the>outer yellow polygon is the new flatten.>>George>>exclusionsq0.jpg>>imageshack.png>Looks sweet! Note that the exclusion does not need to enclose the shape to be excluded. The ENVELOPE of the exclude needs to intersect the ENVELOPES of all of the clipped pieces of the shape to be excluded. In this case, you're fine and what you did is easier. In some cases, where you wish to surgically remove one shape when others of the same type are close by, you may need to more carefully craft multiple exclusion polygons.-Doug

Share this post


Link to post
Share on other sites

Thaks all1. Good to see flatten exclude capability.2. Still a little uncertain about this "texture" attribute. I guess for all vectors except for freeway trafic and gps water polys, there is a texture attribute with the identical value: {1B6A15BB-05FB-4401-A8D1-BB520E84904C}3. Still need to understand how the slpoex and slopey relate to elevations in the shapefile. I see how to compute the values, but how is the slope value applied to the shape elevations. For example, should the polygon have the same elevation for all vertices, or the elevations set to the appropriate elevation computed using the slope scales (and which vertex is taken as the "base" value that the slope scales are applied to?).I guess I will do some testing.scott s..

Share this post


Link to post
Share on other sites

>The slope values are not used by Shp2Vec itself. It is just>pre-computed data (to save time at runtime) that Shp2Vec>passes through to the game.Hello Doug,In FS9 we could make slopped flattens using LWM3 polygon types. In the past I had a tool to set the altitude of all points of a polygon so that the points were in the same 3D plane. That was sufficient for getting slopped surfaces in FS9.Shall I set the altitude of the points plus these SlopeX and SlopeY? In other words, will we be able to make slopped surfaces in FSX?Kind Regards,Luis

Share this post


Link to post
Share on other sites

>2. Still a little uncertain about this "texture" attribute. >I guess for all vectors except for freeway trafic and gps>water polys, there is a texture attribute with the identical>value: {1B6A15BB-05FB-4401-A8D1-BB520E84904C}Hi,My interpretation is:- if the XML file has a reference to {1B6A15BB-05FB-4401-A8D1-BB520E84904C} then it instructs shp2vec that it should read a "texture guid" from the dbase for each of the shapes to be processed. In SBuilder, I am simply copying (and renaming) the XML files into the ../SBuilder/Tools/Shapes folder and do not care about the {1B6A15BB-05FB-4401-A8D1-BB520E84904C}.>3. Still need to understand how the slpoex and slopey relate>to elevations in the shapefile. I see how to compute the>values, but how is the slope value applied to the shape>elevations. For example, should the polygon have the same>elevation for all vertices, or the elevations set to the>appropriate elevation computed using the slope scales (and>which vertex is taken as the "base" value that the slope>scales are applied to?).I did not test yet these SlopeX&Y. I am just exporting the shape files with SlopeX=0 and SlopeY=0. Unless someone tells us that slopped surfaces are not supported in FSX, I plan to evaluate the SlopeX and SlopeY according the description in the SDK. What I recall from high scoll geometry is that if I have the ground projection of a polygon (eg no altitude for the points) plus SlopeX plus Slope Y plus the altitude of a single point, then tye exact position in 3D space of all polygon points will be know.Kind Regards, Luis

Share this post


Link to post
Share on other sites

>>The slope values are not used by Shp2Vec itself. It is just>>pre-computed data (to save time at runtime) that Shp2Vec>>passes through to the game.>>Hello Doug,>>In FS9 we could make slopped flattens using LWM3 polygon>types. In the past I had a tool to set the altitude of all>points of a polygon so that the points were in the same 3D>plane. That was sufficient for getting slopped surfaces in>FS9.>>Shall I set the altitude of the points plus these SlopeX and>SlopeY? In other words, will we be able to make slopped>surfaces in FSX?>>Kind Regards,>>Luis>Yes, you will be able to make sloped water surfaces in FSX. The points of the polygon should be in the same 3D plane. The slopeX and slopeY are the pre-computed (to save runtime) normal to that plane. They are used in extrapolating the plane of the water surface onto the terrain grid.-Doug

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this