Hot answers tagged gml
9
A great GIS that has a huge amount of functionality is QGIS. It is very easy to install especially if you use the osgeo4w installer (Windows). You can use it to view your GML file too.
OSGeo is the place you want to look for OpenSource (free) GIS tools and libraries: http://www.osgeo.org/. You will find a ton of stuff here plus links to QGIS and other ...
9
GML, http://en.wikipedia.org/wiki/Geography_Markup_Language
KML, http://en.wikipedia.org/wiki/Keyhole_Markup_Language
GML / KML difference
http://en.wikipedia.org/wiki/Geography_Markup_Language#GML_and_KML
9
You Can use ogr2ogr. Simplest to install it would be to download fwTools.
the following command will do
ogr2ogr -f "GeoJSON" E:\lakes.geojson e:\lakes.gml
Else if you have QuantumGIS, you can add your GML layer to map and by Right-Clicking the Layer, Select Save As to GeoJSON format.
7
From W3C's Extensible Markup Language (XML) 1.0 (Fifth Edition) recommendation:
[Definition: The XML document type declaration contains or points to markup declarations that provide a grammar for a class of documents. This grammar is known as a document type definition, or DTD. The document type declaration can point to an external subset (a special kind ...
7
If you have the roads in a spatial form, such as a Shapefile, you can load them into PostGIS and have it automatically find those using an SQL query. I've done this before - the SQL statement is designed to find for each road those that intersect geographically and create a nodal point for each crossing.
I will try to clean this up later, but here is the ...
6
I'd suggest starting from http://www.w3.org/Mobile/posdep/GMLIntroduction.html.
If you're planning to work with application schemes in INSPIRE, you'll also need a thorough understanding of XML and XSLT (Extensible Stylesheet Language Transformations).
I think the task doesn't require in-depth understanding of UML. You'll have to be able to read it. Anyway, ...
6
In ArcPy, you can do a table to table conversion, which supports csv.
from ESRI:
"For file input (.csv or .txt), the first row of the input file is used as the field names on the output table. Field names cannot contain spaces or special characters (such as $ or *), and you will receive an error if the first row of input file contains spaces or special ...
6
You can analyze polylines in amazing ways by using buffers. This is usually inefficient--buffers create many additional vertices--but (a) it is a technique available in many GISes (vector or raster based) and (b) it sometimes can produce information that is otherwise hard to get.
In this case, buffering the road by a small amount and then buffering by the ...
6
Same reason --> OGR does not support multiple geometries in one feature
http://www.weichand.de/2012/08/26/qgis-wfs-2-0-plugin-update/comment-page-1/#comment-8177
~~ UPDATE ~~
After the first import of your GML-file there will be a .gfs file in the same directory. This file contains the following part:
<Name>CadastralParcel</Name>
...
5
Every XML document essentially has some given structure. When the structure is formally specified, we usually talk about a given XML grammar.
The formal specification can take many forms, e. g. DTD (Document Type Definition) or XML Schema Definition (XSD). XSD itself is a XML document and is now being used for GML. There are also other means of specifying ...
5
When someone designs a class of XML documents for representing information in a particular domain, they will sometimes call this an XML grammar, or a vocabulary, or a schema, or a document type, or even a language. The terminology isn't consistent. There's perhaps a different emphasis: calling it a schema implies that an XML Schema is the primary way in ...
5
You can use the DataInteroperability (DI) - Import/Export tool (using IGPTool) for the same.
The extension is enabled by default for ArcEditor for certain formats (including CSV and GML) and allows data to be read/written.
I've done a similar export (to GML) some time back and it works perfectly!
5
Looks like you have GML3 but ogr2ogr is expecting it to be GML2. According to the docs (http://www.gdal.org/ogr/drv_gml.html) only GML 2 or GML 3 Simple Feature is supported, since GML3 SF doesn't support surfaces either I'd say you are out of luck.
I'm also not entirely sure if a shapefile can support surfaces either so I suspect that you are going to run ...
5
You can use Python shapefile library pyshp
>>> import shapefile
>>> sf = shapefile.Reader("shapefiles/blockgroups")
>>> shapes = sf.shapes()
>>> # Read the bounding box from the 4th shape
>>> shapes[3].bbox
[-122.485792, 37.786931000000003, -122.446285, 37.811019000000002]
>>># Read the 8th point in the ...
4
You can also look at http://svn.osgeo.org/geotools/trunk/modules/library/xml/src/test/java/org/geotools/GMLTest.java to see how the tests do it. The key section seems to be:
GML encode2 = new GML(Version.GML2);
encode2.setBaseURL(baseURL);
encode2.setNamespace("location", "location.xsd");
encode2.encode(out2, collection);
out.close();
...
4
ST_GeomFromGML
You can store your GML features as a PostGIS Geometry datatype by using the ST_GeomFromGML function which will convert your GML to the geometry datatype. FYI: There are similar functions for KML, WKT, and so on.
just do something like:
INSERT into myTable (mygeomField) values (ST_GeomFromGML('
<gml:LineString srsName="EPSG:4269">
...
4
You could give the GDAL/OGR utility ogr2ogr a try. It has to capability to convert between many formats of vector spatial data.
GDAL/OGR Downloads
ogr2ogr Utility
OGR GML Driver Documentation
Depending on the flavor of your XML/GML it may be able to extract the spatial components straight away, and be as simple as:
ogr2ogr -f "esri shapefile" ...
4
I don't understand if lines are understood by QGIS on kml layer well enough to be saved as Shapefile
I'm not aware of any problems. If the lines are displayed correctly on the map, export to Shapefile should work too.
You already found the solution: Save the GML as Shapefile and you can edit that.
From the mailing list:
The state of the "Toggle ...
3
If you have ArcGIS and if you have also installed the Data Interoperability Extension (ArcGIS-integrated version of FME by Safe Software), you can read simple GML and WFS data sources without a license for the extension (source).
As long as your GML data sticks to the GML Simple Features profile, you do not need to enable the Data Interoperability ...
3
The simple answer is no.
The complex answer is may be but you'll need to understand and use the complex feature extension (http://docs.geoserver.org/stable/en/user/data/app-schema/complex-features.html). This is non trivial so you might want to think about other ways of doing this like making a second request using the boundary of the state polygon as a ...
3
You should have a look on composite surface type :
A CompositeSurface is defined by a
set of orientable surfaces. A
composite surface is geometry type
with all the geometric properties of a
(primitive) surface. Essentially, a
composite surface is a collection of
surfaces that join in pairs on common
boundary curves and which, when
...
3
Yes, you could do this with FME for sure. There are many "transformers" that handle cleanup, intersections, and topology; I would try the TopologyBuilder transformer in this case.
Any scripting is all done in a graphic environment, so it is very simple to do.
You can always get a trial version from www.safe.com
(Disclosure: Mark Ireland, aka FME ...
3
Unfortunately the GML extension has more or less been abandoned due to lack of a maintainer for that extension. That said you can still upload GML as part of a WFS transaction. So a recipe that could work is to create a new empty layer (in postgis or something) via the REST api, and then issue WFS transactions to populate it.
3
I would really need to see your URL to comment on why it doesn't work. Have you tried something like http://ian01.geog.psu.edu:80/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=GML2
In general though WFS requests are made using POST (not GET) with an XML payload to handle the request as it is easy to run into ...
3
After a quick glance it looks like the v2 and v3 JS files derive from base (definitely makes sense too) which offers a read method. Try checking that out.
See: http://github.com/openlayers/openlayers/blob/2.x/lib/OpenLayers/Format/GML/Base.js#L151
If that is not complete or does not meet your needs you can just modify the source. Given the generous ...
3
Try:
//create the encoder with the gml 2.0 configuration
org.geotools.xml.Configuration configuration = new org.geotools.gml2.GMLConfiguration();
org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder( configuration );
//output stream to serialize to
OutputStream xml = ...
//encode
encoder.encode( featureCollection, new QName( ...
3
You should create empty vector layer and then add vector features from your files:
var osm = new OpenLayers.Format.OSM();
var files = ["url1", "url2", "urlN"];
var vector = new OpenLayers.Layer.Vector("OSM Layer");
for (var i = 0; i < files.length; i++){
OpenLayers.Request.POST({
url: files[i],
success: ...
3
This is part of the axis order confusion, where some software expects (x,y) = (long,lat) (the Shapefile way), and others as lat,long (I suppose, the traditional spoken way?).
Read more about the axis order options in the GML GDAL Driver, which can be passed to OGR in either command-line or Python fashion. Try GML_INVERT_AXIS_ORDER_IF_LAT_LONG=NO (or is it ...
3
You can add this projection to the projection table postgis uses and then refer to it with the new name (97460 or SR-ORG:7460 in this case):
INSERT into spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) values ( 97460, 'sr-org', 7460, '+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m ...
Only top voted, non community-wiki answers of a minimum length are eligible


