Topic: GPX

Hi,

I know OnlineMaps has the ability to read GPX files (thanks for that), but I was wondering how I might go about this in RWT and then use this info to create EasyRoad objects? Do you have any suggestions? I'm not overly worried about parsing the GPX myself (although the OnlineMapsGPX object makes this process pretty painless in OLM), it's pushing this data to the EasyRoads plugin I'm confused about :-/

The reason being that I have a GPX file that provides much better quality route information of some cycle paths than the available OSM data for a particular area.


Any help or suggestions would be very gratefully received.

Re: GPX

Hello.

Sorry for the long answer.
We ported classes to work with GPX into RWT.
The new version will be available soon, we need to make one more thing from another thread.

You need to get a GPX route point, convert it to Unity World Point, create a new roadNetwork, and create a road based on points.

As an example you can look at:
RealWorldTerrainRoadGenerator.Generate and RealWorldTerrainRoadGenerator.CreateEasyRoads.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: GPX

Brilliant - thank you

Re: GPX

Hi Alex

I need to import gpx files on a terrain generated with RWT. I tried with EasyRoads, with the import kml process, but it doesn't seem to work very well (the generated road is on a plane). So I found this topic, but I don't undestand what you mean -cf previous post - by "As an example you can look at:RealWorldTerrainRoadGenerator.Generate and RealWorldTerrainRoadGenerator.CreateEasyRoads." I am afraid these are C# commands, right ? Can I find somewhere the full description of the process ? Perhaps could you make PlayMaker actions to do this easily ?
Best regards !

Re: GPX

Hello.

Yes, this is C #.
Theoretically, I can make Playmaker actions.
In practice, it will be a big pain to use this because GPX contains a lot of information. Take a look at this class and nested classes:
http://infinity-code.com/doxygen/real-w … bject.html
Some things are conveniently done with Bolt or Playmaker.
Working with GPX will be very inconvenient.

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

Re: GPX

Thanks Alex for these explanations. I understand it is not easy to work with gpx files which might be different depending on their origin.

A gpx (or kml) file contains points with lng, lat and altitude and other infos. It is very simple to convert a kml or gpx file to a csv list of values, lat, lng, alt (or xml). A "clean" file, with only the info we need.

I think it is not appropriate to use the GPX altitude, as it will often not match the RWT terrain, and be under or above the terrain (bad values, resolution of the generated mesh…)

So we should only use latitude and longitude, altitude being calculated by RWT, as it is done with POIs generation. Altitude might be kept in the file for other purposes (for instance to draw an elevations curve).

Therefore, the Playmaker script would be much more simple, I mean :

- Read the 1st line (or the 1st record if a database is used)
- Get the altitude
- Generate an object at the 1st point (as you do with POIs)
- Continue the same way with all the points.
- Draw lines between each point, if possible following the terrain

For this last point, I am using Simplewaypoints, a powerful tool which generates splines between objects, it could do the job easily.

Re: GPX

If you use CSV, then you just read the line, split the line into parts, parse the latitude and longitude values, and convert it to Unity World Position (GetWorldPositionByCoordinates action).

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!