Export 3D extruded Building data to shape file for use with different program.

EnladeEnlade Global Mapper UserPosts: 7
edited June 2014 in Technical Support
I am evaluating Global Mapper for use with another program made by AGI, called STK. STK does a lot of "access" analysis (line of sight, radio, etc). STK can consider an urban area in its calculations by including a shape file that contains the full 3D representation of buildings or other urban objects. I have found that it is not so easy to get access to 3D building data. There are select cities or areas available, but I would like a more arbitrary approach (within reason). Also, currently the data I need doesn't have to be completely accurate, so missing buildings, buildings that are not gemoetrically accurate, or buildings whose hights are not percise, are all fine for now.

So, what I did was to pick an arbitrary city (Portland) and download the map data from OpenStreetMaps for the area of interest. I then imported that into Global Mapper. I also imported a topography because I will be using one in the STK program and I want the buildings to sit upon it. Of course, OpenStreetMaps gives me a lot of objects I don't need. So, I wanted to delete all objects that do not have a building height. I thought that was the easiest way to get rid of all non-building data. Now, there wasn't really any way to do that search in Global Mapper. It lets you search for things, but not for Null. And I wanted all the fields that had Null as the building height. Maybe there is a way to do that, but I couldn't figure it out, if there isn't then you should probably add that to the program. Anyway, I ended up just sorting by the building height column so all the Null entries ended up together and I selected them all and deleted them. Now that I think about it, it is probably better to leave the OpenStreetMaps file alone and instead search for all buildings with building height and copy them over to a new layer (file/folder). That way if I do want to grab additional buildings and fudge the height data I can get them from the existing OpenStreetMaps file. In that case you wouldn't need to search for Null as well. So, maybe that would have been better.

So, now I have only objects that represent buildings with a building height. But I noticed that there were some building objects that were imported as line objects instead of area objects. I think this was because these objects did not put a 0 in the distance property of the last vertex (I think they left it Null). So, Global Mapper considers them as line objects instead of area objects. Again, this might be something worth fixing. Just treat a Null as a 0 at when you consider what the object type is. In any case, Global Mapper allows me to manually convert each of those line objects into area objects. So, I manually did that. There were also a few point objects that had building height data that got in somehow. But they seemed to just be redundant, so I just deleted them as well. Actually, I didn't delete any of these objects. I simply turned off the line and point data in the project settings after I was done creating all the new area objects. I did this because first time I did the create area object from the line object it copied the wrong data into the new area object. So, there is probably a little bug there. I redid the process from scratch and checked each as I created each area object and it seemed to work, but the first time it copied incorrect data (which dropped the height data or gave me a different height, so that wasn't good).

Ok, so now I have just the buildings that have a building height, and they are all area objects. So, I do all the stuff that is mentioned in the video on the website that talks about extruding the building from the building height data. And I view it in the the 3D viewer and it looks good. Its a little boxie, but that is to be expected.

So, now what? Well, I want to export only the building data (not the topography, though I want it to consider the topography so I can't hide it) into a shape file. Only when I do that I only get the roofs of the buildings exported to the shape file. So, when I bring it into STK it does not show me the entire building, just the roofs (it’s basically just the footprint raised up to the altitude of the building height). What I need is for Global Mapper to generate all of the building vertices for the entire building(s) and export all of those to the shape file.

Like, on your website you have a video where someone is doing what I am saying for NYC, but he never exported his final resulting city back to a new shape file. I can get to that same point, having my city thrown together and viewing nicely in the Global Mapper 3D viewer, but now I want to get that 3D data back out into a shape file that I can use in a different program (STK). Any help on this would be most welcome. Thank you.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2014
    You can search on those items that don't have a value for a particular attribute by searching on the attribute as != to the wildcard *. That should match everything that has an empty or missing value for the given attribute.

    Do you have a sample OSM file where some lines didn't get turned in to areas. If so and you can zip it up and post it or point us to it we can take a look and see why the line didn't become an area. It is likely some kind of missing flag in the OSM XML feature.

    You might want to create a terrain surface from the building areas with height and also 3D building points/lines. To do this, use the Analysis menu command to create an elevation grid. Move the grid tightness slider towards tight so that you don't get the grid created away from the point and line buildings. Or if you just have the building areas active the grid will automatically just be inside the areas. You can then overlay that grid on top of a surface grid to get the buildings burned in to the terrain.

    If you want 3D areas with the sides added as separate features, you currently would have to add a 3D_EX_HT attribute with the value set to the height to extrude to (like '0') to just extrude from the height down to ground. Then export to a KML/KMZ file and any 3D buildings will get the sides added as well. You could then convert that 3D KML/KMZ file in to a 3D Shapefile. Currently KML/KMZ export is the only one that can create extruded edges and bottoms, mainly for floating airspaces since there is an existing extrude option in Google Earth, but it would work for buildings too.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • EnladeEnlade Global Mapper User Posts: 7
    edited May 2014
    Hi Mike, I tried everything to search for Null items except for what you suggested. I kind of thought there must be some way to do it, but just couldn't work it out. Thanks.

    I will try to upload the zipped .OSM file for Portland that I exported from OpenStreetMaps. My assumption was that this is likely a common occurrence for such exported data. It seemed to me that all of the items that got marked as line data instead of area data did not have a 0 distance value for the last vertices (the last point would have distance 0, but the .OSM data sometimes left it as Null). All of the items that got marked as area data had 0 distance for that last vertices. I didn’t look too hard at the data though.

    It is sad that the program doesn’t export the building walls and such to a shape file. All that work is already done for the 3D viewer, so it would be nice to be able to just grab it out into a shape file. In any case, the program seems like a fairly useful tool, but that is really the main reason I am looking at it. I will explore your suggestions though, just to see how much manual effort they may involve, and whether they will work with the STK program. I am only using the trial version and features are dropping off (like I can’t export to shape files anymore), so I don’t know how far I can get (you should really just give people the full trial period without the extra surprise limitations, makes it tough to evaluate when you get surprised by a “No more file export feature for you” popup), but I’ll give it a try anyways. Thanks for the help.
  • EnladeEnlade Global Mapper User Posts: 7
    edited May 2014
    In case anyone else wants to see what I was trying to do, here is the extruded buildings of Portland (only the ones that had height data from OpenStreetMap). Just can't get them out to a shape file, but would be nice.

    Capture.PNG
  • EnladeEnlade Global Mapper User Posts: 7
    edited May 2014
    And here is the portland data after it is loaded in and all of the objects that don't have build height are deleted. Notice some of the remaining building footprints are line data (red lines with empty fill) and others are area data (yellow lines with pink fill). See, the problem is that when you extrude the line data doesn't get extruded properly with walls and such. It just pushes the lines up and they look wierd sitting in space with no walls (definitly not bulding like). So, I had to convert each of those to an area to get them to extrude properly, but they really should be considered an area anyways, but they get loaded as line data. Here ya go.

    AreaLine.PNG
  • EnladeEnlade Global Mapper User Posts: 7
    edited May 2014
    You know if you ever get around to messing with exporting this type of stuff it might also be cool if you could make use of the building level information. You could put ploys in for each floor as well. I mean, maybe someone that wants to use this data to give them a quick templete of some arbitrary city could spend time adding details and such instead of trying to layout each building individually. I don't know, just seems like there is a lot of neat data that could be useful to see used in such a 3D tool as this. Though, not much point if you can't get all that prettyness out to use in other programs :)

    Anyway, thanks for listening. Take care.
  • EnladeEnlade Global Mapper User Posts: 7
    edited May 2014
    See there is a lot of this type of building geometry data being standardized so that a lot of buildings can be made to look very real based on the data coming from openstreetmap (or other sources).

    Simple 3D Buildings - OpenStreetMap Wiki
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2014
    I have updated the OSM XML import to create areas from all of the "building" features that are closed. I also now automatically mark those as extruded and that the elevations are relative to ground. In addition I have added an option to the Shapefile export to create the extrusion faces (i.e. building sides and bottom) when exporting 3D extruded areas to 3D Shapefiles.

    I have placed new builds with the latest changes at the links below:

    32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
    64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip

    Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:

    32-bit: C:\Program Files (x86)\GlobalMapper15
    64-bit: C:\Program Files\GlobalMapper15_64bit

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • EnladeEnlade Global Mapper User Posts: 7
    edited June 2014
    Sounds like it might help, but my trail license won't let me export anymore. So, I will have to find another system to test on. I think I can still use Global Mapper even if this doesn't quite work...so I'll probably buy it. In any case, I just wanted to let you know that I saw your post and will try this as soon as possible. I'll post back here when I have tested it out. Thanks.
Sign In or Register to comment.