1 |
> On Oct 1, 2014, at 5:54, meino.cramer@×××.de wrote: |
2 |
> |
3 |
> Matti Nykyri <Matti.Nykyri@×××.fi> [14-10-01 00:26]: |
4 |
>>> On Tue, Sep 30, 2014 at 08:12:38PM +0200, meino.cramer@×××.de wrote: |
5 |
>>> Matti Nykyri <matti.nykyri@×××.fi> [14-09-30 19:44]: |
6 |
>>>>>> On Sep 30, 2014, at 17:12, Alec Ten Harmsel <alec@××××××××××××××.com> wrote: |
7 |
>>>>> |
8 |
>>>>> |
9 |
>>>>> |
10 |
>>>>>> On 09/30/2014 10:05 AM, meino.cramer@×××.de wrote: |
11 |
>>>>>> Suppose the GPS would already be attached |
12 |
>>>>>> to the board and works... |
13 |
>>>>>> |
14 |
>>>>>> Is there any free available software and data for |
15 |
>>>>>> strict offline useage (which does NOT calls |
16 |
>>>>>> to home), which is able to map GPS data to a street/land |
17 |
>>>>>> map? |
18 |
>>>>>> I need both: The maps themselves and the logic to read |
19 |
>>>>>> GPS coordinates and map movements and ways to those maps. |
20 |
>>>>>> |
21 |
>>>>>> Is something like that available for free or should |
22 |
>>>>>> I directly ask the NSA/CIA/FBI/...? |
23 |
>>>>>> |
24 |
>>>>>> Thank you very much in advance for any help! |
25 |
>>>>>> Best regards, |
26 |
>>>>>> mcc |
27 |
>>>>> The only project I know of that has openly available map data is |
28 |
>>>>> OpenStreetMap (openstreetmap.org). I know they have an API, and they |
29 |
>>>>> probably (not sure) have maps available for download. |
30 |
>>>>> |
31 |
>>>>> afaik the only way to combine various map data out of the box is to use |
32 |
>>>>> a GIS package like QGIS. You can write software to do this using the |
33 |
>>>>> proj4 library for an embedded box, not sure if anything for your |
34 |
>>>>> specific use case already exists and is open source. |
35 |
>>>>> |
36 |
>>>>> Alec |
37 |
>>>> |
38 |
>>>> Sorry iphone send mail even if you don't wanna :/ |
39 |
>>>> |
40 |
>>>> What you are considering doing is quite a challenge. What kind of coordinates does your gps module give you? The gps system works with cartesian x y z coordinates. Then these are usually displayed to the user in WGS-84. This is a quite hard mathematical problem (differential elliptical problem). Usually is done by your gps receiver and is approximated. GIS libraries have these functions built inside. Distances are easier and faster to calculate in cartesian coordinates. You need to calculate distance because coordinates from gps will never coincide with any address. |
41 |
>>>> |
42 |
>>>> Open street maps provides a very good start, but addresses have great differences in different countries. For example google misses addresses quite much depending on where you are searching. Getting the address right requires good locality from the program. Addresses and roads are vector maps. The fastest way to get address is to have the vector map of the world and then calculate distance to the closest address. The database will be huge :) |
43 |
>>>> |
44 |
>>>> Maps are usually raster pictures which have some projection. When you display them you can use 3d or 2d visual. In 3d (like google earth) you draw a sphere (or oblate spheroid) and draw textures on top of is to the right coordinates. In 3d everything needs to be converted to cartesian coordinates. Or in 2d you decide a projection and then convert the projection of your maps to this projection. After that it is just easy drawing. GIS libraries contain all the needed tools for these operations. There are a few of them with open source license. |
45 |
>>>> |
46 |
>>>> I have been doing some work with opengl 3d drawing maps. Good luck your project is quite big but it is sure very much fun :) |
47 |
>>>> |
48 |
>>>> -- |
49 |
>>>> -Matti |
50 |
>>> |
51 |
>>> YEAH! Matti is back! I saw your previous mail and thought: Oh |
52 |
>>> boy...Clint Eastwood is very talkative compared to /him/. ;;;))) |
53 |
>> |
54 |
>> Trashed the phone... and now back to the good old fashion terminal |
55 |
>> connection. |
56 |
>> |
57 |
>>> I am not /that/ serious this evening...sorry... |
58 |
>>> With all the help from this forum this evening I got by far more |
59 |
>>> working results as I have thought... |
60 |
>>> |
61 |
>>> But back to your mail: |
62 |
>>> The GPS module I plan to use is this one (by Adafruit, Lady Ada): |
63 |
>>> https://learn.adafruit.com/adafruit-ultimate-gps/overview |
64 |
>>> From there (see link list on the left) you can also download |
65 |
>>> the manuals (pdf). |
66 |
>> |
67 |
>> Nice... MicroTek chipset. Quite easy to use. |
68 |
>> |
69 |
>>> I will not use this thing as a driving assistant or "navi" (is this |
70 |
>>> common speaking outside germany also...or is it one of those pseudo |
71 |
>>> english german words like "handy" for "cell phone"...dont laugh! This |
72 |
>>> time /I am/ serious! :) ) |
73 |
>>> |
74 |
>>> Its more like a GPS data logger. I plan to copy the gathered data on |
75 |
>>> my PC later and I will try to "draw" them onto a map. |
76 |
>>> May be the results proof later, that I am able to walk through walls |
77 |
>>> and hovering over the face of the waters...;) |
78 |
>> |
79 |
>> Ok. This is easy... You just need some maps... openstreetmaps are good |
80 |
>> for that. From the MT3339 you get NMEA messages and WGS-84 coordinates. |
81 |
>> I would suggest displaying your results in 2D. For germany Lambert |
82 |
>> conformal conic projection is good choice. In this projection all angles |
83 |
>> are true and sreight lines are great circle routes. Just convert the |
84 |
>> maps to this projection and convert your coordinates to Lambert false |
85 |
>> easting and false northing and you will have cartesian coordinates that |
86 |
>> are easy to draw. Even excel is able to draw this in real time :) I don't |
87 |
>> see where you need the address resolution. |
88 |
>> |
89 |
>>> May be the UV-mappinga abillity of this 3D renderig program will help -- I am |
90 |
>>> using it for other purposes since 2006. |
91 |
>>> www.blender.org |
92 |
>> |
93 |
>> From what I know about blender isn't it just 3d rendering program. Not |
94 |
>> a GIS application. It doesn't know anythin about coordinates... |
95 |
>> |
96 |
>>> Will see how far it will go. First step in progress will be acchived, |
97 |
>>> when I can read any data from the GPS module and they are not that |
98 |
>>> changing if I dont move and they will change when I move. The module |
99 |
>>> is ordered and will arrive -- I hope -- next week. |
100 |
>> |
101 |
>> Nice. |
102 |
>> |
103 |
>> -- |
104 |
>> -Matti |
105 |
> |
106 |
> Hi Matti, |
107 |
> |
108 |
> thanks for your explanation. If I start struggling...you will receive |
109 |
> email (ok?) ! |
110 |
> |
111 |
> Blender: |
112 |
> The UV-Mapping of blender maps 2D-Images to whatever shaped things in |
113 |
> 3D quite good...it is used for texturing. |
114 |
> Additionally Blender has a python API, so missing things can added. |
115 |
|
116 |
Of course you can do that, but it's gazillion times harder to do than 2d. If you want to have a good 3d visual (like google earth) you need to calculate your oblate spheroid on the fly and i don't think blender will be able to do that. |
117 |
|
118 |
With basic UV-mapping you will have uneven distribution with poles compared to equator. The best solution is to use icosahedron (like a normal football with alternating hexagons and pentagons). Also with that you will automatically end up with triangles which are better for your GPU. Also the size of the triangles are even throughout the object. No tessellation is required. |
119 |
|
120 |
You will never need to draw more than one half of this spheroid because the other side is hidden an equal to the visual side. If you really wan't conserve memory of you GPU you can just have 1/8 of the vertices of the spheroid. The remaining 3/8 vertices can be created on the fly by a rotation matrix. |
121 |
|
122 |
Even better choice is to have a fixed amount of vertices and draw only the needed parts of the sphere on the fly. You also need to calculate the coordinates for your texture. |
123 |
|
124 |
To have see the goodies of 3d map view you probably want to have tilt with your visual. Otherwise there is not much difference with 2d view. The WGS-84 defines just the spheroid which does not describe earth accurately. Because earth's densities are not equal the height of mean sea level is not equal above the WGS-84 ellipse. To calculate that you need EGM (earth gravitational model). The result is called geoid. EGM96 is now mostly used but newer more accurate EGM2008 is also available. In maps and all other applications heights are always reported as above mean sea level. |
125 |
|
126 |
To calculate coordinates, lets say N52 E16, you take the WGS-84 ellipse that goes through the poles and is 16 deg east of 0 ellipse. Now the N52 is at the ellipse in the point where a normal to ellipse form 52deg angle with equator plane. To calculate where this point is at mean sea level or at arbitrary altitude you need to follow the vector of gravity. Vector of gravity does not have the same direction as the normal to the ellipse, but it is close. The gravity vector is twisted by the gravitational differences of earth (EGM) and the rotation of earth. These will give accurate result but in most applications it is not needed. A GIS library can do these calculations. Inverse of this is much much harder to do accurately (but every gps receiver needs to calculate it and usually use approximating algorithms). |
127 |
|
128 |
So if you want to draw a map of lets say Aachen you it is not efficient to have vertices of the entire earth in GPU's memory. It is much better to have lets say 10000 points in Aachen and draw the texture on top of them an calculate the coordinates on the fly. If you are drawing areas bigger than Europe then you have more advantages with 3d view. |
129 |
|
130 |
> Just a shot in the dark... |
131 |
|
132 |
It would be nice to hear how well blender is able to do this :) |
133 |
|
134 |
-- |
135 |
-Matti |