Hot answers tagged xml
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
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 ...
6
Before I try to answer, a tip. Your exception handler covers up the nature of the problem. Just let the original exception rise up and you'll have more information to share with people who are interested in helping you.
I like to use feedparser to parse Atom feeds. It does indeed give you dict-like objects. I submitted a patch to feedparser 4.1 to parse the ...
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 ...
4
It looks to me like the server is trying to validate your XML request, and failing to find the XSD that contains the definition of GetRecords.
I think the EPSG sample is outdated for that server, because changing the CSW namespace to http://www.opengis.net/cat/csw/2.0.2 gets me some more errors about the Query element. Annex C of the EPSG API spec tells us ...
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
If you load the data into PostGIS, is there a column created for this category you mention? If so, you could use that attribute to specify the output shapefile name by setting the dynamic writer properties to use that attribute as the feature type name.
Another possibility is using something like imposm.parser and Python to parse the XML file and generate ...
4
OSM2GEO - A JS Converter to convert OSM to GeoJSON
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The F##% You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*
...
4
Updated: OSM Reader for FME 2013 (Beta)
=========================== BUILD 13082 20120417 ===========================
===========================================================================
OSM reader: Updated to support reading very large datasets, for example
~764 million features on a European OSM dataset (PR#37345)
...
4
Instead of getting the dataset:
// Retrieve the first feature dataset from the workspace.
IEnumDatasetName enumDatasetName = workspace.get_DatasetNames
(esriDatasetType.esriDTFeatureDataset);
You can get the feature class by:
IEnumDatasetName enumDatasetName = workspace.get_DatasetNames(esriDatasetType.esriDTFeatureClass);
See this thread:
...
3
I sometimes find that the official OSM Xapi is not that reliable, indeed it is currently shown as being down for maintenance.
You will probably be better off using the Mapquest Open API - url as follows:
http://open.mapquestapi.com/xapi/api/0.6/node[amenity=restaurant][bbox=9.4908142,48.7810801,9.5660019,48.8387351]
They also have good docs for all ...
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
You cannot combine filter options (condition A && condition B).
What you can do is filter in two different steps - first keep only ways satisfying the source condition and then filter the first step's result using the attribution condition.
E.g.:
./bin/osmosis --rx file=ireland.osm --tf accept-ways source=* --un --wx step1.osm
./bin/osmosis --rx ...
3
Use a capitalized Or instead of all-caps OR to wrap your criteria:
<ogc:Filter>
<ogc:Or>
<!-- Criteria -->
</ogc:Or>
</ogc:Filter>
I can't find any definitive answers about case sensitivity in filters, but the XML schema on the OGC site uses "Or" instead of "OR".
3
The only useful data in the screenshot you added of the XML contents is the path to a .jpg file. Why don't you just locate that and bring it into ArcGIS? ArcGIS won't be able to understand the XML file directly.
You'll have to georeference it manually if it doesn't have an accompanying "world" file (.jgw, typically).
Side note: XML is just a markup ...
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
If you can get a hold of the X-Ray for ArcCatalog add-in (link currently broken for me, the author's site is here if you want to contact them directly), I remember seeing a Python implementation of XML workspace document import/export tools.
There is also the Table Compare tool which you can set to do a schema-only comparison between two tables; you could ...
3
If you are at 10.1, try using the Export XML Workspace Document (Data Management) geoprocessing tool.
I'm not sure exactly what it will do if you specify a feature class that participates in a relationship class, but I imagine it will include the relationship class and related object classes as well.
3
I enjoy using ElementTree. It's standardized in Python since 2.5 as xml.etree.ElementTree. Forgive me for being blunt, but you're using it wrong. I suggest trying the find, findtext, and findall methods when you know the structure of the data. Is Order your root element? If so,
>>> geography = rootElement.find('OrderRequest/SiteGeography')
...
2
The .xml file is your metadata file. It is created whenever you save an .mxd because arcmap expects you to add metadata to all your ArcMap projects. It doesn't damage your .mxd to delete it; but really you should be adding metadata to all your maps anyway so you will only be re-creating it later on if you do delete the .xml
2
GeoNames has a database you can download and a web service that you could just connect to. See http://ian01.geog.psu.edu/geoserver_docs/data/geonames/installing.html for an example of how to download it and load it into a postgis database.
2
It's more comfortable to use lxml for XML processing. Here is an example that fetches the feed and prints earthquake titles and coordinates:
import lxml.etree
feed_url = 'http://earthquake.usgs.gov/earthquakes/catalogs/1hour-M1.xml'
ns = {
'atom': 'http://www.w3.org/2005/Atom',
'georss': 'http://www.georss.org/georss',
}
def main():
doc = ...
2
Yes the process can be scripted. To build one. the best how-to walk through ive seen is.
http://www.doughellmann.com/PyMOTW/xml/etree/ElementTree/parse.html
Doug builds a xml to csv script and explains the process well.
If this process is something your going to do/rerun often consider a look at FME, it has excellent XML to . tools.
but if a one off is ...
2
This is a high-level answer as you've not given any specifics.
Reading KML is basically the same as XML (KML being a subset thereof).
Some possible resources:
http://stackoverflow.com/questions/8342337/parse-kml-file-with-php
http://www.boards.ie/vbulletin/showthread.php?p=71913675
http://web.stefanproell.at/wp/2010/01/parsing-kml-files-with-php/
Then ...
2
Here is an example of a WMS from my config file...
<layer label="NWS RADAR" type="wms" autorefresh="66" skipgetcapabilities="true" url="http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0q.cgi" version="1.1.1" visible="false" visiblelayers="nexrad-n0q-900913" alpha=".5"/>
That is a RADAR layer I'm getting from the University of Iowa. Here is one ...
2
I'm afraid it's impossible. Mapquest provide this service for free and quite reasonably do not wish to allocate resources to unreasonably large requests, as they would take up disproportionate server time and degrade the server for other users.
As an aside if you are doing this for either large amounts of data or frequently, you should consider using a ...
2
The problem was with Format.XML. I had to redeclare a new XML format everytime I made a wps call.
var xmlFormat = new OpenLayers.Format.XML();
//read gml feature as xml
var xmlfeature = xmlFormat.read(gmlFeature);
Also, ie cannot use XMLSerializer...
// this fails in IE
var xmlSerializer = new XMLSerializer();
var featureString = ...
2
why dont you use ArcGIS SOAP or REST service interfaces. it already gives you what you want... it has query field which returns the result as html,json,kmz and amf too..
you can check out some service here, at least in terms of giving an idea...
This is an example service link, will return you id:129 object properties:
...
2
If by edit multiple SLDs you mean edit them programmatically then you might want to check out Python-SLD. It's a Python library that enables dynamic SLD creation and manipulation.
Azavea has a tutorial on how to use Python-SLD.
Only top voted, non community-wiki answers of a minimum length are eligible
