Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Geography Markup Language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Coordinates=== ''Coordinates'' in GML represent the coordinates of ''geometry objects''. Coordinates can be specified by any of the following GML elements: <syntaxhighlight lang="xml"> <gml:coordinates> <gml:pos> <gml:posList> </syntaxhighlight> GML has multiple ways to represent coordinates. For example, the <code><gml:coordinates></code> element can be used, as follows: <syntaxhighlight lang="xml"> <gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> <gml:coordinates>45.67, 88.56</gml:coordinates> </gml:Point> </syntaxhighlight> When expressed as above, the individual coordinates (e.g. ''88.56'') are not separately accessible through the [[XML]] [[Document Object Model]] since the content of the <code><gml:coordinates></code> element is just a single string. To make GML coordinates accessible through the XML DOM, GML 3.0 introduced the <code><gml:pos></code> and <code><gml:posList></code> elements. (Although GML versions 1 and 2 had the <code><gml:coord></code> element, it is treated as a defect and is not used.) Using the <code><gml:pos></code> element instead of the <code><gml:coordinates></code> element, the same point can be represented as follows: <syntaxhighlight lang="xml"> <gml:Point gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> <gml:pos srsDimension="2">45.67 88.56</gml:pos> </gml:Point> </syntaxhighlight> The coordinates of a <code><gml:LineString></code> geometry object can be represented with the <code><gml:coordinates></code> element: <syntaxhighlight lang="xml"> <gml:LineString gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> <gml:coordinates>45.67, 88.56 55.56,89.44</gml:coordinates> </gml:LineString > </syntaxhighlight> The <code><gml:posList></code> element is used to represent a list of coordinate tuples, as required for linear geometries: <syntaxhighlight lang="xml"> <gml:LineString gml:id="p21" srsName="http://www.opengis.net/def/crs/EPSG/0/4326"> <gml:posList srsDimension="2">45.67 88.56 55.56 89.44</gml:posList> </gml:LineString > </syntaxhighlight> For GML data servers ([[Web Feature Service|WFS]]) and conversion tools that only support GML 1 or GML 2 (i.e. only the <code><gml:coordinates></code> element), there is no alternative to <code><gml:coordinates></code>. For GML 3 documents and later, however, <code><gml:pos></code> and <code><gml:posList></code> are preferable to <code><gml:coordinates></code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)