-
Notifications
You must be signed in to change notification settings - Fork 2
data
This page is a full description of all dataformats that are supported by k3b-geoHelper.
- Introduction
-
dataformats
- Geo uri
- gpx-1.0, gpx-1.1 and gpz
- kml-2.2 and kmz
- wikimedia that is used by web-apis of wikipedia and wikivoyage
- poi and poz
-
Data Fields
- ll=lat,lon : Latitude(north), Longitude(east)
- n=name : name, title or caption of the point
- d=description : Information about the point.
- z=zoomLevel : how much detail should be shown
- z2=ZoomMax : (not used yet. reserved for zoom intervalls)
- link : url pointing to additional informations
- s=symbol : symbol-id or url pointing to a symbol, preview-image, icon
- id=id : unique number or value identifying the point.
- t=time : that relates to the point
- geoUri : (xml only) contains info in geo-uri or various http(s)-geo-url formats
- infer=1 : (xml with geoUri only) try to infer lat,lon and name from description
k3b-geoHelper's main purpose is to handle points and regions of the world that can be shown in a map.
A region of the world usually has a
- geographic coordinate that defines the center of the region as latitude-north and longitude-east.
- zoomlevel that defines how big the visible part of the world is. With zoomlevel 1 you can see all continents. With zoomlevel 6 you see one country. With zoomlevel 13 you will see streets.
- optionally a name that can become a title of a bookmark.
A point-of-interest or poi-marker usually has a
- geographic coordinate in the map as latitude-north and longitude-east
- optionally a description some plain or html text describing the point-of-interest.
- optionally a name of the point-of-interest.
- optionally a link with a url pointing to additional informations.
- optionally a symbol with a png or jpg icon url belonging to the point-of-interest.
There are several possible dataformats that k3b-geoHelper can handle:
- geo uri-s
- gpx-1.0 , gpx-1.1 and gpz files or urls.
- kml-2.2 and kmz files or urls that are used by google
- wikimedia that is used by web-apis of wikipedia and wikivoyage
- poi and poz files or urls, k3b-s internal xml format
Here is a short introduction of the supported formats. You can find a more detailed description in the fields section.
Geo uri with k3b-s extensions
A geo uri describes a visible region to display or a geografic point of interest
In general a geo uri looks like this
- geo:lat,lon?q=(name)&z=zoomLevel&z2=ZoomMax&link=link&s=symbol&d=description&id=id&t=time
- geo:0,0?q=lat,lon(name)&z=zoomLevel&z2=zoomMax&link=link&s=symbol&d=description&id=id&t=time
Example:
- geo:0,0?q=52.366667,9.716667(Hannover)
The same way as a webbrowser can interprete a url like http://github.com/ android apps and the k3b-geoHelper library can interprete geo:0,0?q=52.366667,9.716667(Hannover) .
Since k3b-geoHelper needs more than the current geo uri standard defines there are some k3b-geoHelper-specific additions to the format. For a complete list see fields section.
Note: uri field content
- it can be url-encoded, but it is not neccessary.
- it must be url-encoded if the field contain url-special-chars ? or &
Examples that the lib can parse:
- geo:...&d=hello+world&...and
- geo:...&d=hello%20world&.. are valid geo uris while
- geo:...&d=hello world&...is not a valid uri but k3b-geoHelper understands it.
Note: Currently GoogleMaps for android supports "geo:0,0?q=52.366667,9.716667(Hannover)" but not "geo:52.366667,9.716667?q=(Hannover)"
- java api
See also: gero-uri junit-tests
- /k3b-geoHelper/src/test/java/de.k3b.geo.io.GeoUriTests.java
gpx-1.0 and gpx-1.1 xml file format
gpx-1.0 and gpx-1.1 is a standard xml fileformat to describe one ore more geografic points of interest.
gpz or .gpx.zip means gpx in zip file that may also contain the referenced Symbol images. The Zip structure is inspired by the kmz zip format.
In general gpx xml looks like this:
- <gpx version="1.0" ...><wpt lat="lat" lon="lon"><name>name</name>....</wpt></gpx>
- <gpx version="1.1" ...><trk><trkseg><trkpt lat="lat" lon="lon"><name>name</name>....
k3b-geoHelper will extract a poi-marker for every gpx wpt or trkpt element. For a complete list see fields section.
See also gpx junit-regression-testdata
- /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/gpx10.gpx and
- /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/gpx11.gpx
kml-2.2 xml file format
kml is the xml fileformat that is used by google.
.kmz or .kml.zip means kml in zip file that may also contain the referenced Symbol images.
In general kml looks like this
- <kml>...<Placemark>...<coordinates>lon,lat</coordinates>...<name>name</name>....</kml>
k3b-geoHelper will extract a poi-marker for every kml Placemark element.
For a complete list see fields section.
See also kml junit-regression-testdata
- /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/kml22.kml.
wikimedia web-api-xml file format
This is the xml fileformat that is used by the web-apis of wikimedia, wikipedia, wikivoyage, ... .
Example: this query asks the german wikivoyage.org for entries around "Las Palmas, Gran Canaria"
In general wikimedia looks like this
<api ...><query><pages>
<page pageid='7445' title='Las_Palmas' touched='2015-02-10T08:04:45Z' fullurl='https://de.wikivoyage.org/wiki/Las_Palmas'>
<coordinates><co lat='52' lon='9'/></coordinates>
<thumbnail source='theIconUrl' width='50' height='38'/>
</page>
</pages></query></api>
Wikidata is slightly different
Example: this query asks wikidata.org for entries around the greek island of "Rhodos"
The answer looks like this
<api ...><query><pages>
<page _idx="34777" pageid="34777" ns="0" title="Q31833" ... >
<entityterms>
<label>
<term>Aquarium of Rhodes</term>
</label>
<description>
<term>
research centre, aquarium and museum in Rhodes, Greece
</term>
</description>
</entityterms>
<coordinates>
<co lat="36.4571" lon="28.2207" primary="" globe="earth"/>
</coordinates>
</page>
</pages></query></api>
k3b-geoHelper will extract a poi-marker for every page element.
For a complete list see fields section.
See also wikimedia junit-regression-testdata
- /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/wikimedia.poi.
k3b-s internal poi xml format
The k3b-geoHelper internally uses its own poi xml format to define a visible region and to describe poi-marker details.
.poz or .poi.zip means poi in zip file that may also contain the referenced Symbol images. The Zip structure is inspired by the kmz zip format.
Most geo uri parameters correspond to a xml-attribute with the same name.
In general poi looks like this
- <poi ll='lat,lon' n='name' z='zoomLevel' z2='zoomMax' link='link' s='symbol' d='description' id='id' t='time' geoUri='geoUri' />
k3b-geoHelper will create a poi-marker for every poi element. For a complete list see fields section.
See also poi junit-regression-testdata
- /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/poi.xml.
This paragraph lists the fields currently supported by k3b-geoHelper.
- java
- interface IGeoPointInfo
- class GeoPointDto implements IGeoPointInfo
It contains an example for each dataformat that supports the current field.
- geo:179.345,-86.7890123?...
- geo:0,0?q=179.345,-86.7890123&...
- <gpx version="1.0" >...<wpt lat="179.345" lon="-86.7890123">...
- <gpx version="1.1" >...<trkpt lat="179.345" lon="-86.7890123">...
- <kml>...<coordinates>-86.7890123,179.345</coordinates>...
- wikimedia: <page...<co lat="-86.7890123" lon="179.345"/> ...
- <poi ll='179.345,-86.7890123' ... />
- java
This field is used to define
- map´s visible region
- a map´s bookmark
- a point-of-interest in a map.
note: GoogleMaps on android only understands "geo:0,0?q=..."
- geo:0,0?q=(Name of the point)&...
- geo:0,0?q=(Name+of+the+point)&...
- geo:0,0?q=179.345,-86.7890123(Name of the point)&...
- geo:?...&n=Name of the point&...
- geo:?...&n=Name+of+the+point&...
- geo:?...&n=Name%20of%20the%20point&...
- <gpx>...<name>name</name>...
- <kml>...<name>name</name>...
- wikimedia: <page title='name' ...> ...
- wikidata: <page><entityterms><label><term>name</term>...
- <poi n='Name of the point' ... />
- java
This field is used to define
- a bookmark in a map
- a point-of-interest to be displayed as the title of the map's bubble.
note: GoogleMaps on android only understands "geo:0,0?q=179.345,-86.7890123(Name of the point)"
-
geo:...&d=Some Text that describes the point&...
-
geo:...&d=Some+Text+that*describes+the+point&...
-
geo:...&d=Some%20Text%20that%20describes%20the%20point&...
-
<gpx>...<description>Some Text that describes the point</description>...
-
<kml>...<description>Some Text that describes the point</description>...
-
wikimedia: <page>...<extract>Some Text that describes the point</extract>...
-
wikidata: <page><entityterms><description><term>Some Text that describes the point</term>...
-
<poi d='Some Text that describes the point' ... />
-
<poi ><d>Some Text that describes the point</d></poi>
-
java
This field is used to define
- a point-of-interest to be displayed as the main text of the map's bubble.
Value 0..18 or -1 if there is no value
- 1=World
- 3=Continent (ie Africa)
- 6=Country (ie Germany)
- 18=MostDetailed.
- -1=no zoomlevel
This field is used to define
- the visible region as the map's zoomlevel and bookmark's zoomlevel
z2=ZoomMax : (not used yet. reserved for zoom intervalls)
- geo:...&link=https://link/to/some/page.htm&...
- <gpx version="1.0" >...<url>https://link/to/some/page.htm </url>...
- <gpx version="1.1" >...<link href='https://link/to/some/page.htm' />...
- <kml>...<atom:link href='https://link/to/some/page.htm' />...
- wikimedia: <page fullurl='https://link/to/some/page.htm' ...>...
- <poi link='file://sdcard/copy/test.htm' ... />
- java
any kind of url is possible. ie:
- http: and https: for internet links
- file: for local files
- content: android specific content uri (ie for media items)
- intent: url to android specific activity
- geo: url to a point in an other map/zoomlevel
This field is used to define
- a point-of-interest as the link button in the map's bubble.
-
geo:...&s=https://link/to/some/image.png&...
-
<gpx>...<sym>https://link/to/some/image.png </sym>...
-
<kml>...<Style>...<Icon><href>https://link/to/some/image.png </href>...
-
wikimedia: <page ...><thumbnail source="https://link/to/some/image.png" />...
-
<poi s='file://sdcard/copy/test.jpg' ... />
-
java
any kind of url is possible.
If the symbol contains a colon ":" it is interpreted as a url. else as an id.
- geo:...&id=42&...
- wikimedia: <page pageid='42' ...> ...
- <poi id='x97' ... />
- <poi ... ><id>x97</id>
- java
Note: In the sample files for the automated /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/ the id attribute contain the expected parsing result in geo:-uri format.
- geo:...&t=2015-02-10T08:04:45Z&...
- <gpx>...<time>2015-02-10T08:04:45.000Z</time>...
- <kml>...<when>2015-02-10T08:04:45.000Z</when>...
- wikimedia: <page touched='2015-02-10T08:04:45.000Z' ...> ...
- <poi t='2015-02-10T08:04:45Z' ... />
- java
time is in iso date format ISO8601.
example: if the poi represents a foto then the time corresponds to "when the photo was taken".
For a list of different supported time formats see : time-parser junit-tests
- /k3b-geoHelper/src/test/java/de.k3b.util/IsoDateTimeParserTests.java
- <poi geoUri='geo:0,0?q=179.345,-86.7890123(Name of the point)' />
- varios http(s)-url-formats for maps.google.com, www.openstreetmap.org, www.here.com, www.yandex.com
- For examples see junit-regression-testdata at /k3b-geoHelper/src/test/resources/de/k3b/geo/io/regressionTests/https-mapservice-urls.xml
This way you can use geo uris in xml.
Note: Since "&" has a special meaning in xml it must be escaped using "& amp;"
- <poi geoUri='geo:?d=Text containing (Name of the point) with a loc 179.345,-86.7890123' />
the uri parser can try to find name and LatLon from other fields this way.