Hot answers tagged

13

You can convert OSM XML to GeoJson with ogr2ogr. To convert to GeoJSON without getting the following error: ERROR 6: GeoJSON driver doesn't support creating more than one layer You can use one of the following commands or all of them: ogr2ogr -f GeoJSON points.json data.osm.pbf points ogr2ogr -f GeoJSON lines.json data.osm.pbf lines ogr2ogr -f GeoJSON ...


9

Are the xml files *.aux.xml? If so, it's not QGIS creating them, it's the GDAL library which uses them to store metadata, including statistics. You can disable completely by setting the environment variable GDAL_PAM_ENABLED=NO though I don't advise this if you'll be displaying the rasters again as there won't be any statistics cached. Instead, you can ...


9

Your best bet is to use InkScape and convert your graphics to SVG. Polygons can be filled with rasters, but points and markers need SVG. If your symbol is available in a font, you can also use Font markers. It's fairly straightforward:- Load bitmap (png, jpg etc) into Inkscape with File > Open File > Save as (use Plain SVG rather than default Inkscape SVG) ...


8

osmtogeojson is yet another OSM-to-GeoJSON converter, which has a few benefits when compared to this (OSM2GEO) or osm-and-geojson: can be used as a command line tool as well as a javascript (browser and nodejs) library. proper multipolygon support sophisticated polygon detection stable (can cope with incomplete OSM data) well tested faster The library ...


8

Data needs to located in a geodatabase in order to export to XML. You can do this manually, or use the tool Export XML Workspace Document (Data Management). For the manual approach, simply right-click the featureclass or raster dataset within the file geodatabase > Export > XML Workspace Document. Which then brings up the following GUI, where you can ...


7

For those who will stumble on this question like me.. It appears that the plugin has been generated (https://github.com/strk/mapnik/tree/2.3.x-pgraster) and has been merged in official Mapnik Repo. The branch is 2.3.x (https://github.com/mapnik/mapnik/tree/2.3.x) Now you can build Mapnik from the branch and use PGRaster plugin to use Raster data from ...


7

Here's what we've been doing to set up THREDDS Data Server (TDS) catalogs for regional oceanographic modeling providers in the US Integrated Ocean Observing System to serve their models results. There are four basic types of catalogs we have been setting up: A top level catalog that points to other catalogs that you want exposed An "all" catalog that ...


7

Business rules vs data integrity rules When you model your database, you specify the business logic in two spaces: a. The data integrity rules. This includes among others having an integer column so users won't be able to enter strings. b. The business domain rules. This includes having check/unique/foreign key constraints on columns so it won't be ...


7

The .xml file is the metadata file. An XML/metadata file is not a compulsory file needed to form shapefiles. The minimum files needed are: .shp — shape format; the feature geometry itself .shx — shape index format; a positional index of the feature geometry to allow seeking forwards and backwards quickly .dbf — attribute format; columnar ...


7

You can use rasterio for getting geo-coordinates from pixel coordinates, and pyshp (shapefile) for creating a shapefile. import rasterio import shapefile # -> pyshp module import xml.etree.ElementTree as ET # get pixel coordinates from XML root = ET.parse('/path/to/file.xml').getroot() xmin = float(root.findall('object/bndbox/xmin')[0].text) ymin = float(...


6

Functions in rgdal read data into sp class objects, which can only contain one type of spatial object - a set of points, or lines, or polygons. The sf package provides classes for geometry vectors that can have different dimensions geometries within. Using sf::st_read("file.kml") should return an object with a geometry column, and you can filter lines or ...


5

If you are comfortable with Python, you could use ElementTree to parse the XML and pyshp to create the shapefile. Here is something you can start with: from xml.etree import ElementTree import shapefile import os xml_file = 'input.xml' shape_file = 'output.shp' projection = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298....


5

There is a service that allows you to retrieve any administrative border from OpenStreetMap in a number of formats. https://osm.wno-edv-service.de/boundaries/


5

GPX files use XML namespaces (look at Parsing XML with namespace in Python via 'ElementTree' or Read GPX using Python ElementTree.register_namespace? for example). The namespace is {http://www.topografix.com/GPX/1/1} import xml.etree.ElementTree as ET tree = ET.parse("St_Louis_Zoo_sample.gpx") for elem in tree.findall("{http://www.topografix.com/GPX/1/1}...


5

You have to unzip Qgz file first. Then you can edit the qgs file with any text editor.


5

The qml file style file you get when exporting layer styles is different from the one you get in the "Style manager" when you export. The second format is the accepted one in "Create categorized renderer from style" What is missing is a script to get "Style manager" compatible file from an existing layer style. I've made a ...


4

The thing here is that you have given the example of amenity = school tag, but you are actually querying building = school. It is normal for buildings inside school to be tagged as building = yes, hence the query will not return them. In the second query, the format of bbox-query should be like below. <bbox-query e="7.25" n="50.8" s="50.7" w="7.1"/> ...


4

You can certainly use FME to wrangle the XML and write it to a database. Something for you to understand first is that GIS like flat data with rows and columns, including geometry. XML is not flat, it is a (maybe big) hierarchical tree, which is a fundamentally different data model than most GIS formats. That said, you can parse the XML and extract all the ...


4

If you want to convert it to a Shapefile just download the xml (for example right-mouse-click on the download link and choose something like "save target as..." instead of opening it in the browser. then in Qgis choose "add vectorlayer" or use drag and drop to add your xml layer to your Qgis project. then save layer as shapefile. If you are just looking for ...


4

I think your issue has been addressed here. As given in the second paragraph, For example, if the metadata describes the item as having one projection but the item's projection has changed since the last automatic update, the old projection information in the metadata will be replaced with the new projection information. Basically geoprocessing tools are ...


4

You can add this statement SET XML OPTION DOCUMENT; at the beginning of the SQL backup file. Source : https://hub.qgis.org/issues/10079


4

Your task to connect the house number automatically to the street name will surely fail in many cases. Just imagine a street crossing with four different named streets, where the house number could be related to any of them. The only working way is to add the full adress information to the house number during editig, using the Karlsruher Schema. The ...


4

As far as i know there is no such tool, as the last comment in your Linked Question mentioned. The problem with xml is that it is extensible... It means anyone can create a new schema or alter an existing one. Its a hierarchical document type with lots of possiblities to use different attributes and so on. When you want to change a schema you need to ...


4

XML files can hold any kind of data. If a software like QGIS should be able to read it, the software (or the developer) needs to know the XML schema of the data. QGIS is able to read Openstreetmap XML data, and (with the LandXML plugin) data provided by Land Information New Zealand. If you need support for other XML sources, you might have to do it on your ...


4

I have some comments/suggestions for you. You mention that you do not have any admin privileges on your machine to be able to install the metadata module. Good news here, you don't need admin to install python packages/modules. You do if you're using a binary install, however, most modules can be installed using pip. You can just download pip and put it ...


4

Look at How to calculate distances in a point sequence?, you need to iterate by pair of points to compute the distances points = zip(lats,lons) # or directly with a list comprehension points = [(float(mainElement.attrib['lat']), float(mainElement.attrib['lon'])) for mainElement in tree.findall('{http://www.topografix.com/GPX/1/1}wpt')] print points ...


4

Since this is mainly a mapping question you are better off at http://help.openstreetmap.org/. OSM has different address schemes. The most popular scheme is the Karlsruhe Schema where you add at least addr:housenumber and addr:street to an object. If this object (e.g. a POI) is located inside another object (e.g. a house) you can omit these addresses and ...


4

That is not supposed to work. SortBy is defined in the WFS 1.1.0 standard as The SORTBY parameter is used to specify a list of property names whose values should be used to order (upon presentation) the set of feature instances that satify the query. The value of the SORTBY parameter shall have the form “PropertyName [A|D][,PropertyName [A|D],…]” ...


4

As far as I know, this schema doesn't exist. (Similarly, there is no schema for QGIS project files, which are XML as well.)


4

This works with QgsMapLayer().exportNamedStyle() the following way (here for the active layer): >>> from PyQt4.QtXml import QDomDocument >>> d = QDomDocument() >>> iface.activeLayer().exportNamedStyle(d, '') >>> s = d.toString() >>> s u'<!DOCTYPE qgis PUBLIC \'http://mrcc.com/qgis.dtd\' \'SYSTEM\'>\n<...


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