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

Map-ity Open Street Map data for Unity - Official

Discussion in 'Assets and Asset Store' started by RewindGameStudio, Oct 21, 2013.

  1. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    Ok one important question I forgot to ask. Since I have the map info downloaded, will buildr generate without memory errors?
     
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    If you're using U5, blueivy, I imagine you'll have less pressure on memory than I did when attempting to run it on 4.5 or 4.6.

    Let us know how it goes! It would be great if there was an easily workable method for using Buildr and/or Road Architect / EasyRoads on smaller sections of Mapity map, while still being able to link it all together in the end as one unit.

    EDIT: What might be ideal is to be able to lay a mask on top of a section of Mapity map and then push a button to fill in streets and buildings in that masked area.
     
    Last edited: Mar 22, 2015
  3. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    630
    That masking solution would be ideal @RewindGameStudio do you think that's possible? Also I will see if I run into any memory issues with unity 5 later today
     
  4. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Map-ity is interesting. I will buy it. I've looked at OpenStreets before and their data is pretty good. If you've ever opened a GeoPDF with all the layers that's a bit like OpenStreets. You have to filter what you need.

    What I've really been wanting is an asset that can build islands and fake the ocean / lake data but that's not so easy when the island I guess doesn't go over 3 metres higher than the ocean and sometimes not even a metre.
     
    RewindGameStudio likes this.
  5. szlangtue

    szlangtue

    Joined:
    Mar 27, 2015
    Posts:
    9
    RewindGameStudio
    with Map-ity in Unity,It provides a map annotation function? For example, the annotaion(or label) along road.Note the direction of text has been facing users.
    thk you.
     
  6. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Unfortunately Map-ity doesn't provide this functionality.
     
  7. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
  8. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    You need to set the location. Have a look in the manual here: http://www.rewindgamestudio.com/documentation/current/Map-ity.pdf

     
  9. olenedgar

    olenedgar

    Joined:
    Nov 3, 2014
    Posts:
    3
    Hi,

    Map-ity looks very interesting for one of my projects. I am wondering if it would be difficult to implement the simplistic line based look of the Editor screenshots into the game window or would that require an extra purchase of something like supersplines?
     
  10. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Hi. You just need to use a line renderer. Unity has one or it would be simple enough to write your own. I think there are also some community ones available.
     
  11. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Hello I wanted something like that (mention previously in the thread) for the island of martinique, what's the format to dl such a package?
     
  12. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Hi. All you have to do is find the location you want on a site like openstreetmap.org and they allow you to download the data.
     
  13. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    with full precision?
     
  14. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    It will be the full data.

    You can even view it on openstreetmap.org. They have a setting to allow you to overlay the full data.
    upload_2015-5-28_8-45-11.png
     
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I just purchased it but it is not very clear how to use the API. The documentation describes how to setup the Mapity panel on the Inspector, but there is no information available on how to get the data using your own script. Can you provide a simple example on how to get an array with only the roads from a separate script?

    Also, it would be nice if I can browse a map online with a proper viewer, select a rectangle, download the selected data to be used offline, and load that into mapity. Would that be possible?

    Furthermore, how can I set the bounding box for the map data to be downloaded?
     
    Last edited: Jun 11, 2015
  16. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Hi Elecman,
    Thank you for the purchase.

    Take a look at the CodeSampleScript.cs file. This provides some basic script examples.

    Downloading data in an external viewer is possible.

    For example, go to www.openstreetmap.org.
    Click export.
    Either export or manually select the area you want and click export.
    upload_2015-6-11_13-19-19.png

    • Change the extension of the downloaded xml file to a .mapity file.
    • Drop that file into the MapData folder for Map-ity.
    • Untick Download Map Data
    • Enter the name of your file in the Offline Map Filename field.
    Map-ity currently only provides square bounding boxes unless you use the above method.

    Then run. Hope this answers your questions!
     
  17. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Thanks, the map downloading via the open street map site works :)

    But looking at the CodeSampleScript.cs doesn't make things obvious. Your code is slightly more advanced then average, dealing with singletons, registering events, etc. This is great, but it makes deciphering your code a bit harder.

    May I humbly suggest you provide real API documentation?

    By the way, what is a way? No pun intended.
     
    Last edited: Jun 12, 2015
  18. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Glad that worked for you.

    We could look into a more simplified example, but in the mean time is there anything specific you'd like help with?

    A way is a group of connected nodes. They may be a road, or a boundary. You can check out the open street map wiki for more about information on the data format and what it means.
     
  19. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Thanks. I figured out how to extract the data now.

    Keep up the good work :)
     
  20. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Bug fix Incoming! Geonames height queries were broken. If immediate fix is required contact us :)
     
    hopeful likes this.
  21. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Fix has been subbed to Unity, should go live soon.
     
  22. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    thanks!
     
  23. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    How do I build a larger map/area? I have centered the area where I want it, but I want a larger radius of data queried.
     
  24. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Now that Road Architect seems to be abandoned, can you work on integration with Easy Road?
     
    Meceka and hopeful like this.
  25. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I have a feature request. For purposes of matching up the Map-ity drawn stuff with an underlying map, can you add a checkbox that, when activated, changes the color of all the Map-ity lines to neon green so it is easier to see on the image map?
     
    RewindGameStudio likes this.
  26. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    You can define custom zoom levels by modifying the zoom levels enum in the Mapity. cs file.
     
  27. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    We could perhaps add color pickers to the debug line rendering?
     
  28. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    We can. What features would be of use to you?
     
  29. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    That worked great! I now can crank it up to 20. ;-)
     
    RewindGameStudio likes this.
  30. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I would like to be able to do something similar to what you have done for Road Architect. Basically take the highway data and generate the appropriate roads using the Easy Roads API. (Including intersections would be awesome!) I posted similarly on the Easy Roads thread and he mentioned that you have begun to work together. That's great! Consider me a beta tester as I have both products and a desire to use them together.
     
    hopeful likes this.
  31. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    @Tinjaw - Just so you know, I've asked about this same thing earlier in the thread. The thing is that EasyRoads V3 has been under development for over a year and a half, and no one knows when it will finally come out of beta.

    But - hopefully! - it is finally getting close. A match of Map-ity and EasyRoads sounds perfect. :)
     
    RewindGameStudio likes this.
  32. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    I'm also wishing an easyroads-mapity interaction.
    I think you should get in contact with easyroads developer and ask if there will be a major difference on it's runtime api until it gets officially release. (if that's how mapity would interact with it). I think there is a long time since it's release, but even in beta it works great.
     
  33. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I have been working on a scene that was working fine. But now something has happened and I cannot "Snap To Terrain". I get an error.

    MissingComponentException: There is no 'Terrain' attached to the "surface" game object, but a script is trying to access it.
    You probably need to add a Terrain to the game object "surface". Or your script needs to check if the component is attached before using it.
    UnityEngine.Terrain.SampleHeight (Vector3 worldPosition)
    Mapity+MapBounds.GeographicToWorldCoordinate (.Position geographic) (at Assets/Mapity/Scripts/Mapity.cs:506)
    Mapity+<ProcessMap>c__Iterator3A.MoveNext () (at Assets/Mapity/Scripts/Mapity.cs:1217)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <LoadingCoroutine>c__Iterator39:MoveNext() (at Assets/Mapity/Scripts/Mapity.cs:1112)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    Mapity:Load() (at Assets/Mapity/Scripts/Mapity.cs:928)
    MapityEditor:OnInspectorGUI() (at Assets/Mapity/Editor/MapityEditor.cs:72)
    UnityEditor.DockArea:OnGUI()
     
  34. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Has the terrain been removed from your scene?
     
  35. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    We've reproduced the error by trying to build a map when no terrain is in the scene but the snap to terrain option is on.
    We can add error handling code for this.
     
  36. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Fix:
    Code (CSharp):
    1. if (snapToTerrain && Terrain.activeTerrain )
    2.             {
    3.                 world.Elevation = Terrain.activeTerrain.SampleHeight(world.ToVector());
    4.             }
    We'll submit a patch soon.
     
  37. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    @RewindGameStudio I had terrain with mapity. I removed the terrain and replaced it. That's when I get the error. I can't remember for sure, but I think I removed and re-added mapity and still got the error. I put the project oh hold since then. I will double check it at work tomorrow.
     
    RewindGameStudio likes this.
  38. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I had my project saved to version control. I just checked it out on a different computer and built the map and then snapped it to terrain and all worked fine. It must have been some kind of corruption fixed by what I did. Glad it is working now. Thanks.

    == UPDATE==
    I got the error again. It seems if I check Snap To Terrain and then Build Map I get the error about missing terrain. However, if I Build Map and then check Snap To Terrain I don't get the error. However, the Mapity gizmos don't snap to the terrain.
     
    Last edited: Aug 30, 2015
  39. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I deleted the Map-ity prefab from my scene. I saved the scene. I exited Unity. I restarted Unity. I added the Map-ity prefab. I had it grab data from the Internet and snap to terrain and I built the map. It now seems OK. I will save the data to a file now and use that going forward.

    However, I saved the scene and reloaded it and now the error occurs. Somehow the link is getting broke.

    Here's as video of me attempting to get Mapity data. http://screencast.com/t/jkW4dlCX7
     
    Last edited: Aug 30, 2015
  40. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    If I deactivate my EasyRoads3D Road Network, it seems to work fine. Is it possible the raycast you are doing is hitting the road network instead of the terrain?
     
  41. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,080
    Can the BuildR + mapity building generation be used in real time?
     
  42. zeb33

    zeb33

    Joined:
    Nov 17, 2014
    Posts:
    95
    Great asset, but are there any instructions/demos on using World composer and BuildR integration?
    (+vote for easyroads integration)
     
    RewindGameStudio likes this.
  43. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    As a user of all those assets you mentioned, I can tell you that all of that is good and getting better.

    As for using Map-ity with World Composer, all you have to do is 1) Have the WC window open, and 2) check the box and Map-ity will use the center lat/lon from WC as its own center lat/lon.


    As for BuildR integration, it broken just recently when BuildR was upgraded to 1.5.x. However, I contacted @RewindGameStudio yesterday, and today it has been fixed. The examples will be updated with the next release. Just look in the folder for an example at design-time as well as runtime.


    And I have seen Map-ity and EasyRoads3D coordinate integration already. So we should have a nice match between these assets in the future.
     
    RewindGameStudio, zeb33 and hopeful like this.
  44. zeb33

    zeb33

    Joined:
    Nov 17, 2014
    Posts:
    95
    Fab - thanks for update
     
  45. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    That might be it.

    If you could send us a sample scene that would really help us fix it for you.
     
  46. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    If anyone needs a new BuildR sample just contact us and we'll send you a direct link :)

    As mentioned it will be in the next release.
     
    hopeful likes this.
  47. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    upload_2015-9-19_22-58-10.png

    We've started adding basic terrain snapping to our BuildR sample, thanks to Tinjaw for the starter code.
     
    hopeful and Tinjaw like this.
  48. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey does the terrain snapping only apply to Unity terrain or can other types be used too? Just thinking
     
  49. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Current implementation uses: Terrain.activeTerrain
     
  50. RewindGameStudio

    RewindGameStudio

    Joined:
    Oct 21, 2013
    Posts:
    194
    Changes made today include:
    Terrain snapping for the BuildR Sample.
    Fixes for latest version of BuildR.

    We've also recently improved the UI:
    upload_2015-9-20_1-25-0.png