Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GIS question: importing shapefile map from CityEngine into Unity

Discussion in 'Editor & General Support' started by cappelle, Sep 2, 2014.

  1. cappelle

    cappelle

    Joined:
    Aug 28, 2014
    Posts:
    2
    I'm trying to import a shapefile map into Unity (I'm completely new to Unity). I was able to export it as a .fbx file and then import that into Unity. However, it seems to lose all the individual map areas / polygons in my map, as well as all attribute info (http://en.wikipedia.org/wiki/Shapefile#Shapefile_attribute_format_.28.dbf.29). What I would like to do is import the 2D map, then shade the map areas within Unity to create a choropleth map using data from an external data file (http://en.wikipedia.org/wiki/Choropleth_map).

    It might seem unusual to put a 2D map in a 3D environment but I want to use the 3D features for zoom/pan etc.

    Thanks for any help!
     
  2. OllyNicholson

    OllyNicholson

    Unity Technologies

    Joined:
    Jun 17, 2011
    Posts:
    142
    Hi - As of 4.x Unity imports meshes and textures e.g. polygons and bitmap data. To work with 2D shapes, splines or vectors you would need first to convert to polygons and use perhaps a 3D application (3D studio design, Max or Revit for example) to assign separate materials/material ID's and allow Unity to import these. In other words Unity does not import 2D shapes / vectors at this stage. Unity will probably help you do what you need but not without some serious scripting in terms of converting database info into visualising a choropleth map, either at runtime or generating editor materials in Unity to apply to these ID's or shape areas.

    Alternatively you might bypass the shape import entirely and generate your shapes procedurally somehow or leverage some of the add ons from the asset store, or indeed try the new UI feature in 4.6 to generate shapes.

    In any case here are some links that may help further your research:

    http://answers.unity3d.com/questions/159433/can-i-use-unity3d-for-data-visualizations-i-mean-3.html
    http://unity3d.com/unity/beta/4.6
    https://www.assetstore.unity3d.com/en/#!/content/3495
    https://www.assetstore.unity3d.com/en/#!/content/4318
    http://jayelinda.com/modelling-by-numbers-part-1a/
     
    cappelle likes this.
  3. cappelle

    cappelle

    Joined:
    Aug 28, 2014
    Posts:
    2
    Thanks for your explanation and links, that's very useful. I cannot bypass shape import, because I'd like to establish a procedure to import complex shapefile maps within minutes. Maybe the best option is to export to the SWF vector format instead and import it using uniSWF? http://u3d.as/content/flaming-pumpkin-ltd/uni-swf-standard-flash-to-unity/32e
    I didn't see much else in terms of importing vector shapes.
     
    OllyNicholson likes this.