Skip to main content
12 votes
Accepted

Is srsName of "EPSG:4326" spec compliant in GML 3.1 / 3.2?

Yes, srsName="EPSG:abcd" is GML-3 compliant but only in an application context where EPSG:abcd points to a CRS definition. As of 2013, OGC best practice (documented here) is to use http URIs of the ...
Steven Kalt's user avatar
8 votes

Reading in a single polygon from a shapefile

Time to ditch the shapefile! Here's a reproducible example using a combination of packages sf, gdalUtils and dplyr: library(sf) library(dplyr) library(mapview) library(gdalUtils) ## as an example we ...
TimSalabim's user avatar
7 votes
Accepted

Load specific layer from GML to GeoPandas

GeoPandas allows the layer keyword in read_file. db = gpd.read_file('pth/to/5221132-NS7010', driver='GML', layer="my_layer_name")
martinfleis's user avatar
  • 2,447
7 votes
Accepted

Reading GML features with shapely in Python?

You can use any Python library that parse xml files (see Using Python to parse an XML containing GML tags or How to extract data from GML file for example) With pygml that provides the Geo Interface ...
gene's user avatar
  • 55.2k
6 votes
Accepted

GeoServer DescribeFeatureType response missing attribute for GML only

As far as I know, you are not seeing a bug. The schema reports anything in addition to the attributes already inherited from "gml:Feature", which already contains a "gml:name" ...
Andrea Aime's user avatar
  • 17.6k
5 votes

Using ogr2ogr to convert GML to shapefile in Python?

Eric Levine's Answer works, however the linked ogr2ogr.py is a bit outdated (file says 2013). For e.g. the flag "-nlt CONVERT_TO_LINEAR" is not implemented. Instead of using ogr2ogr (command ...
Magnus's user avatar
  • 251
5 votes
Accepted

How to convert gml:pos to latitude and longitude?

You are almost right: The false Northing is -100000, so the "real" Y coordinate is 456089 meters. The point is 50 km East and 456 km North of the natural origin, that is 2° West and 49° North. Here ...
AndreJ's user avatar
  • 76.9k
5 votes
Accepted

Using ogr2ogr to convert multiple GML files to a postgis table

Looking at your examples, I assume you are working on a Windows machine. Try the following: Copy/Move/Put the remaining 149 GML files in a directory, say D:\myGMLs. Paste the codes below into a text ...
Ralph Tee's user avatar
  • 1,732
5 votes
Accepted

OGR2OGR - converting a GML file to GeoJSON

Use the 'layer' option: ogr2ogr -f GeoJSON .\3925845-HW5929.geo.json .\3925845-HW5929.gz LayerNameHere Alternatively, if you need more control, you could use a SQL query with the '-sql' option.
Alex's user avatar
  • 487
5 votes

Selecting certain text from attribute values in QGIS using field calculator

Use regexp_match() to find the features that contain the string 'Nonconiferous Trees', see documentation: case when regexp_match( descriptiveTerm, 'Nonconiferous Trees') then 'Mixed Woodland Fill' end
Babel's user avatar
  • 73.9k
5 votes

Opening GML file with collection of geometries in QGIS

That Inspire data has features which are hard for QGIS. some attributes are lists, like this: habitatSpecies|HabitatSpeciesType|localSpeciesName|LocalNameType|localName (StringList) = (4:Alnus ...
user30184's user avatar
  • 68.1k
4 votes
Accepted

What is the conceptual meaning of featureMember in GML?

Informally, its a single "entity" that is modelled in the data - like a row in a database or shapefile. For example in this segment, each featureMember is an airport: <gml:featureMember> &...
Spacedman's user avatar
  • 65.6k
4 votes

Read GML using Java

You've imported the wrong GML and Version you want: import org.geotools.wfs.GML; import org.geotools.wfs.GML.Version; To do this you will need to import gt-xsd-wfs using: <dependency> ...
Ian Turton's user avatar
  • 82.7k
4 votes
Accepted

Trying to determine which CRS this GML uses

Use projfinder.com. Stick your coordinates in the box, zoom the map to where you think the point should roughly be, click "Find My Projection" and it scans thousands of projections and sees ...
Spacedman's user avatar
  • 65.6k
3 votes

Open data on buildings in Montreal

You can download the 2015 LiDAR data (including buildings - class 6) here. 3d models of buildings for certain boroughs are available here and here. You can also get OpenStreetMap extracts for ...
Brent Edwards's user avatar
3 votes

Open data on buildings in Montreal

I'm not sure about shapefiles, but a basemap dataset ("cartographie de base") is provided here: http://donnees.ville.montreal.qc.ca/dataset/cartographie-de-base It's available in DWG format and ...
dbaston's user avatar
  • 13.2k
3 votes

Which topology file formats are supported by QGIS?

What is topology for you ? (same in your question Python library to create topologies). It seems to me that you mix topology, geometry and file formats From ArcUser: Understanding Topology ...
gene's user avatar
  • 55.2k
3 votes

Creating simple citygml 3D models based on 2D shapefiles (alkis) shp2gml using Python?

I build my citygmls based on german alkis-files (shape-files), but it can be used also with other building information sources after changing the code. Main steps import shapefile for 2D building ...
hotzar's user avatar
  • 79
3 votes

Creating a Geoserver App-Schema mapping file for GeodesyML

I am the technical lead of GA’s effort to adopt GeodesyML. I see that you’ve solved your problem by upgrading to a later version of GeoServer. I would like to suggest a slightly different approach to ...
Lazar Bodor's user avatar
3 votes

Load LoD2 files into QGIS

Kind of. In QGIS 2.x it is possible to load them, but not as 3D geometries. All CityGML files will be loaded in as simple polygons. GDAL converts the multipatch shapefile to polygons with z/m-...
B.Quaink's user avatar
  • 465
3 votes
Accepted

Geoserver WFS Feature Schema Enumeration of Strings

As far as I know, what you're attempting to do is not possible, it would require new code to be written to either: Make the schema configurable via UI (the xml schema snippets are a semi-working ...
Andrea Aime's user avatar
  • 17.6k
3 votes
Accepted

GML axis order problem in QGIS

Axis order in coordinate systems and in GML is a complicated thing. The issue is all too complicated to be handled as a gis.stacexchange answer but I recommend to start by reading this https://wiki....
user30184's user avatar
  • 68.1k
3 votes
Accepted

How can I determine the original spatial reference system of GML coordinates when I have their WGS84 equivalent but no EPSG?

If its a global coordinate set and has come from a web-based mapping system there's always a good chance its in EPSG:3857 - google's web mercator. Try that, and if everything is in the right place ...
Spacedman's user avatar
  • 65.6k
3 votes
Accepted

Trying to import Dutch Infrastructure GML using OGR GMLAS driver, but no geometries?

It turns out the secret is to list all the schemas on the command line rather than just the root one. So after fetching the schemas (look for a list of imports in the top of imkl2015-wion.xsd) you can ...
Ian Turton's user avatar
  • 82.7k
3 votes

prevent ogr2ogr from generating new fid attribute field

From @ThingumaBob comment: alias your PK column AS fid: ogr2ogr wants that identifier for GML, and it seems the driver will add that field in any case. Aliasing the collumn I wanted as fid worked ...
ousekmatej's user avatar
3 votes
Accepted

Show GML on map (using an example GML file)

The first problem with the above code is that GML example is in WFS 1.0.0 format, which means you have to use OL GML2 format (for GML3 it has to be 1.1.0). But then comes the next problem: displayed ...
TomazicM's user avatar
  • 26.5k
3 votes

GeoServer GML Direct

You can't do that easily, GML is a great interchange format but a very poor storage format as you have parse all of it to be able to serve parts of it. Convert your GML into a database table or ...
Ian Turton's user avatar
  • 82.7k
3 votes
Accepted

GeoServer WFS GML reporting wrong polygon coordinates

There is a setting, under "Global Settings", "Number of Decimals (GML and GeoJSON output)", controlling how many decimals are used to represent coordinates. It normally defaults to ...
Andrea Aime's user avatar
  • 17.6k
3 votes
Accepted

Convert Multi-layered GML file to GeoJSON

GeoJSON can have only one layer https://gdal.org/drivers/vector/geojson.html#layer A GeoJSON datasource is translated to single OGRLayer object with pre-defined name OGRGeoJSON The layer name part ...
user30184's user avatar
  • 68.1k
2 votes

Linux Tool to visualize CityGML file

3DCityDB supports CityGML: https://www.3dcitydb.org/3dcitydb/ At first you need to import a CityGML file to the database (I would suggest PostGIS) and then you have 3DCityDB-Web-Map-Client based on ...
dmh126's user avatar
  • 6,772

Only top scored, non community-wiki answers of a minimum length are eligible