Help Wikitravel grow by contributing to an article! Learn how.

User:Blackisha/Workspace/Map Making Markup

From Wikitravel
Jump to: navigation, search

I believe the source format of the maps contributed to wikitravel should be in a semantically-meaningful xml format, rather than a vector/bitmap format that stores no information on street names, distances, places to stay, pubs etc. etc.

If the map is created using a generic drawing program and saved in a general purpose vector format, any notion of tying street names to the lines on the map is lost, nothing can be done with the map in any way, other than a user looking at the map.

For instance, a xml document of the following form would be alot more useful for many purposes..

<xml>

<map name='Perth' country='Australia' format='relative|latlong'>
<dimension scale='1:1000' top='192.4543' left='432.4323' bottom='412.4322' right='432.4323' />
<river>
<linestart long='123.4344' lat='234.434' />
<line long='324.433' lat='545.4333' />
<line long='324.434' lat='545.4334' />
<line long='324.435' lat='545.4339' />
<line startlong='324.438' startlat='545.4345' />
<line startlong='324.439' startlat='545.4350' />
<line startlong='324.442' startlat='545.4360' />
<lineend long='324.442' startlat='545.4360' />
</river>
<road type='oneway|double' name='Johnson' type='street|lane|terrace|etc..'>
<linestart long='123.4344' lat='234.434' />
<line long='324.433' lat='545.4333' />
<line long='324.434' lat='545.4334' />
<line long='324.435' lat='545.4339' />
<line startlong='324.438' startlat='545.4345' />
<line startlong='324.439' startlat='545.4350' />
<line startlong='324.442' startlat='545.4360' />
<lineend long='324.442' startlat='545.4360' />
</road>
</map>

</xml>

Using a (easy!) format such as this would facilitate the use of a offline map editor (i.e. a mozilla xul application), users easily adding new roads, adding pubs, restaurants, sites (which could be stored in a distinct xml document, i.e. LaPaz.map.xml LaPaz.buildings.xml) etc.

In the case of 3rd parties using the maps, they could be used in conjunction with css/xsl stylesheets to customise the look of the map. i.e. Lonely planet uses just black&white maps, whereas Footprint uses a map with many colors, (i.e. grey road with black outline), also the icons could be customised for each type of building, i.e. the pubs, restaurants etc.

a css file may look like this (not sure yet)

road
{
width:4px;
margin: 1px black solid;
background: rgb(rgb-for-grey);
join: <different road-joining algorithms, i.e. mitre-joing|simple>
}

this element would outline the visual style of the map. a simple change in this file would result in the whole map changing style, & lead to more consistent looking maps overall (all maps using 1 stylesheet, different authors but they all look the same). This is a very similar concept to how css is used in-the-wild for xhtml.

plz, add comments ideas.


Hey, Blackisha, that's exactly the idea I had some month ago! But I saw one big problem: What would be the software to render that map-markup? OK, I have done same experiments in writing some, but the stuff turned out to be much more complicateted than it seemed to me at the first view. Have you got any concrete ideas about that approach? --- Hansm 18:17, 2004 Jan 4 (EST)
I'm going to write a Python program to turn a list of lat/longs to an SVG path. The input isn't XML, but you can write that part.
There should be at least three ways to specify a line: "to" draws a straight line on the map, "gc" draws a great circle, "lox" draws a loxodrome. I think circles should also be supported, in a manner similar to SVG, but figuring out what a circle turns into in az-eq-area is going to be tricky. -phma 07:46, 29 Jan 2004 (EST)
This looks good for geografical maps if you once have a set of coordinates. Then, there remains still the problem of drawing different types of roads, rivers, lakes, cities, etc. Btw, I could find out what loxodrome means, but what is "az-eq-area"?
Azimuthal equal area, the least distorting map projection. -phma
As far as I understand Blackisha, the XML-idae referes rather on city-maps than on country-maps. I had been thinking about a way to avoid coordinate-pairs, since getting them is a troublesome job. My idea was to give descriptions like: "From A-Place, B-Street goes 100m east, makes a 30°-left courve, intersects with C-Street, D-Street, E-Street and finaly reaches F-Place." It should be possible to extract all needed coordinates from a set of this descriptions. -- Hansm 09:27, 2004 Jan 29 (EST)
On city maps, Cartesian coordinates are good enough. The earth can be considered flat to one second of arc up to about 400 km2. If you define paths by bearings and distances, you usually accumulate roundoff error and have to figure out where to put it. -phma 20:17, 29 Jan 2004 (EST)

Hey, sorry for not replying to all of your informative replies. I think I was in bolivia at the time (and hence quite interested). I will have a look at this again. I had a look at hacking mozilla when I got back, but it seemed quite complicated (not as easy as html that's for sure) and got disillisioned. Also, I think there is a XMl markup language for this kind of thing, (MapXML?). using XSLT, you could probably generate an SVG/someVectorFormat view of the maps (and then easily a bitmap format). This approach would allow for theme-ing of maps etc. I am also inteested in using maps online for a different approach (plotting world events on a map and also a timescale, p.s. how do I put in the current date? Also, some kind of system, for allowing users to drive around on roads with a gps, forming a grid of points, which the software then turned into vectors, that users could tag as roads/intersections etc. Blackisha

Well, as well as Hansm, this is exactly the system what I thought about the last weeks. The problem is how to generate a map from it, not important whether generated from a XML file or a MySQL database (which is IMHO much easier going with PHP/WikiMedia than XML, though I consider the latter as better for map descriptions). The problem is that objects contain their coordinates and not vice versa, resulting in the fact that you have to plot the whole map before showing. In reality instead you're zooming into a certain field of [lang-lat|lang-lat], and so it'd be better if the coordinates would contain the objects, or at least to have a combination of this two concepts to keep the possibilty to define i.e. streets as whole. So, like Hansm, I couldn't get a working implementation either and I am thinking this must be a wrong way to solve the problem of map-generating. Do you know, how map services like map24.com work? Please forgive me my bad English ;), Sebastian

Variants

Actions

Destination Docents

In other languages