Tag Info

Hot answers tagged

22

I would suggest downloading and installing QGIS. You can then open the file that you link to and export the data in variety of formats. The most common format for spatial data of this type is a shapefile which is one of the files that you linked to (TM_WORLD_BORDERS_SIMPL-0.2.zip). The reason that it is a zipfile is that there are several associated files ...


17

This works with the default "Add vector layer" dialog You'll have to add the bounding box to the query manually if necessary. It's also not difficult to import GeoJSON into QGIS. For an example covering point geometries see "Tweets to QGIS".


15

OGR: ogr2ogr -f GeoJSON test.json "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer/0/query?where=objectid+%3D+objectid&outfields=*&f=json" OGRGeoJSON That command will read the query result directly from the URL. You can also supply it with a text file containing your JSON or you can directly ...


13

According to Mike Bostock (and other contributors to the TopoJSON extension): TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. TopoJSON eliminates redundancy, offering much more compact representations of ...


8

Here's a link to Esri's doc on JSON geometry objects. From that page: The REST API supports 4 geometry types - points, polylines, polygons and envelopes. Sounds like multi-polygons are not supported. See below. You can create multi-polygons by adding additional rings. There's nothing explicit about interior v. exterior rings. I'm curious so I'm going ...


8

I like @celenius' answer; however, another option would be to export the the World Borders Dataset to CSV using ogr2ogr. I just downloaded your preferred dataset and ran this command with ogr2ogr --note that your script should be a single string without any line breaks. I find them easiest to write in notepad with wordwrap turned on, then I copy them into my ...


7

You'll have to patch existing software in order to use such a format, but there's nothing wrong with embedding GeoJSON in other JSON formats. JSON is super extensible like this. Every object is its own namespace. If you look in the other direction, there are some applications, namely Leaflet, http://geojson.io, Fiona's command line programs, that will ...


5

ESRI JSON to GeoJSON (for OpenLayers) *Likely to be modified for Leaflet javascript //create esri JSON object var myReturn = "esriObj = "+xmlHttpGet(restCall, false); eval(myReturn); I can now work with esriObj as a JSON object i.e. esriObj.geometryType. What happens in the xmlHttpGet method? Basically I create a XMLHttpRequest and pass in ...


5

You can also see Esri's geojson-utils on Github that "contains [javascript] utilities for converting GeoJSON to other geographic json formats and vice versa. Currently only GeoJSON to Esri JSON has been developed. Also, note that only geometries in the WGS84 coordinate system are supported."


5

Stick to a single where parameter in your query string. Here's an example of a where clause hitting multiple fields: ...


5

Your generated GeoJSON is valid JSON, no problem. But, it's not valid GeoJson, as you can see here: http://geojsonlint.com/ The problem seems to be that the features-array in your featurecollection contains three features, two with geometry:none and one with just geometry (which is also string-encoded). So, in short: Your OpenLayers-code seems fine, the ...


4

Check in Firebug (Firefox) or Fiddler (IE) if your file internet_users_2005.json.fixed is in fact being loaded. I suspect there's a problem with the path.


4

Leaflet and ArGIS vector layer. https://github.com/JasonSanford/leaflet-vector-layers Working demo. http://geojason.info/leaflet-vector-layers/demos/arcgis-server/ More on Leaflet and ArcGIS. Leaflet and ArcGIS Server layers i.e. AgsDynamicLayer and AgsFeatureLayer. You can get this fork which has support for ArcGIS server. ...


4

Solved by himself : Adding ?compression=false to the request query will output unencoded data. A proof that smeagol and gollum can work together. ( what is compression, my precious? )


4

Use the JSON Reader and then use a VertexCreator transformer. This transformer (which was previously called the 2DPointReplacer) will let you convert the X/Y coordinate values into a true spatial feature. Then you can simply write the data to your Geodatabase Writer. Make sure the Allowed Geometries field is set to geodb_point


4

This is by design, you are sending it a feature set and not a singular geometry. If you'd like the Geometry on its own, do this: import json geom = arcpy.AsShape(json.loads(json_string)["features"][0]["geometry"], True) We thought in many cases people would like to parse full Esri JSON feature sets and not just individual geometries, so that's why it ...


3

Polygons are rendered in Google Maps API using Canvas, which uses a zero-winding fill rule. To show a hole, you'll need to define the hole using the opposite winding to the outer path.


3

To me it looks like the Google Maps version does not understand the holes in the same way as your original source. You need to find out how holes are expected to be defined in Google Maps. It might be that you are missing some points that needs to close each hole-polygon before going to the next. I don't know how Google Maps defines this, it's just a ...


3

There are plenty of APIs out there support JSON-P and use spatial data. Here's an example of a little youtube spatial search app I did: http://swingley.appspot.com/maps/yt The youtube API returns JSON-P. GeoNames also has several web services that return JSON-P. The pros of this are that you can do everything on the client- there's no server side ...


3

I've built a server object extension to generate GeoJSON from ArcGIS Server map services. It's been tested with 10.1 and 10.2 but not earlier. https://github.com/geobabbler/AGSOpenFormats


3

The code below works for me. using System; using System.Text; using System.Net; using Newtonsoft.Json; using System.IO; using Newtonsoft.Json.Linq; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { try { string baseUrl = ...


3

It's fairly easy with urllib2. Say you've got a gigantic url like this: http://myserver/path/to/a/thing?json1={"data":[1,2,3,4,5]}&json2={"data":[1,2,3,4,5]}&json3={"data":[1,2,3,4,5]} All you need to do is take the query (everything after the ?) and jam it in the data argument to urlopen. import urllib2 import urlparse # GET return_data = ...


3

Use a Cluster Strategy in combination with a BBOX Strategy. Perhaps you should come at this from a different angle. You are not far off with your Restrict Area idea. Don't dismiss this idea too soon as reducing the usefulness of the tool. In your current approach you are loading all sites at once and then adding them to a vector layer. This means that at ...


3

you can read json file in openlayers with OpenLayers.Format.GeoJSON(). jsLayer = new OpenLayers.Layer.Vector("MyLayer", { strategies: [new OpenLayers.Strategy.Fixed()], projection: map.displayProjection, protocol: new OpenLayers.Protocol.HTTP({ url: "jsons/roads.json", format: new OpenLayers.Format.GeoJSON() ...


3

If you're executing a query against an ArcGIS service, just set the output spatial reference to the geographic coordinate system of your choice (e.g. 4326 for WGS84). This will give you lat / long.


3

You must use a geoJSON file (The GeoJSON Format Specification) and not a simple JSON file. Your example is not a GeoJSON file (no 'geometry' tag for example) As example, GitHub announced that you can now automatically view any GeoJSON files that may be in a repository inside an interactive map driven by MapBox technology (see my example AAC.geojson) And ...


3

It's possible that the original source of the data is a format which has features not supported by ESRI shapefiles. For instance, shapefiles don't support storing attribute data anywhere other than the attribute table (the "properties" section of the GeoJSON). This means the feature.id data isn't recorded in the shapefile. With a little hacking, it would be ...


3

To convert TopoJSON files to Shapefiles using ogr2ogr you'll need to install the geojson-cli package for Node.js using the Node Package Manager (NPM). You can follow the instructions below or read this article on installing both. # If you need to install Node and NPM... wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz tar -xzvf node-v0.10.24.tar.gz ...


3

I'd like to respond to my own question for the benefit of others that may have encountered a similar problem. The following special cases (at least) need to be considered when reading ArcGIS data using GDAL/OGR libraries: GDAL/OGR cannot process GeoJSON results containing UNICODE characters (\uABCD style) ArcGIS limits the amount of objects returned per ...


3

Look at the samples on the specification site. You'll need to write a script in the language of your choice that will get you from [ {"date":"2014-09-25","time":"20:49:09","lat":"53.269","lon":"6.935","depth":"3.0","place":"Meedhuizen","mag":"1.5","type":"GH","last":"True"}, ...



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