New answers tagged

0

In case anyone comes across this question and needs to convert to/from Esri (ArcGIS) json, geoJson, or WKT, I created a small application called geometry-inspector. It is much like the listed applications in the accepted answer, but with the improvement that it supports Esri's json format. Hope it helps someone!


2

The GeoJSON is valid and renders fine, see http://playground-leaflet.rhcloud.com/kogi/edit?html,output. However, the use of jquery to fetch it is not. Make sure the request is returning JSON (hint: use dataType: 'json' in your jquery ajax call), and do not stringify the result Ion the contrary, run JSON.parse() if all you've got is a string). If you ...


1

Yes, you can use layer.bringToFront() and layer.bringToBack() methods of leaflet. See the docs here.


0

SELECT ST_AsEWKT( ST_SetSRID( St_GeometryFromText(' MULTIPOLYGON(((295098.566494 6006717.0377012,344018.26458971 6009163.022606,329342.355161 5972473.2490342,295098.566494 6006717.0377012))) ') ,900913) ) SELECT ST_AsText( ST_SetSRID( St_GeometryFromText(' MULTIPOLYGON(((295098.566494 6006717.0377012,344018.26458971 6009163.022606,329342.355161 ...


1

Because of CORS-issues you cannot(?) load files directly from the harddrive. But there is a simple solution: if you have python installed, you can use the builtin web server. Simply run python -mhttp.server <portnumber> or python -mSimpleHTTPServer <portnumber> , depending on your python version (version 2 uses SimpleHTTPServer and ...


0

You can do it: query the data from MySQL with PHP, parse the data to geoJSON (or JSON or XML) format, then display on Google Maps.


0

The child FeatureCollection would be considered a Foreign Member as per the specification So it is a legal object, but applications will not necessarily treat it as a GeoJson object. Another approach is to use a JSON array of FeatureCollections. Note that the array is just JSON. Only the items in the array are GeoJson objects, since according to the spec, ...


0

In GeoJson, features and feature collections have properties, Geometries don't. Points in a Multipoint geometry all inherit the same properties of their container feature. The standard way to express this in GeoJson would be a Feature Collection containing a collection of features, each feature contains a point geometry and arbitrary properties. { "type": ...


2

A GeometryCollection that contains only an array of points is less optimal than a MultiPoint. See https://tools.ietf.org/html/draft-ietf-geojson-03#section-3.1.8. To maximize interoperability implementations SHOULD avoid nested geometry collections. Furthermore, geometry collections composed of a single part or a number of parts of a single type ...


2

Update: nested collections are specifically NOT RECOMMENDED in the latest GeoJSON specification. To maximize interoperability implementations SHOULD avoid nested geometry collections. Furthermore, geometry collections composed of a single part or a number of parts of a single type SHOULD be avoided when that single part or a single object of multi-part ...


1

1) a MultiPoint GeoJSON (list of coordinates) {'type': 'MultiPoint', 'coordinates': ((197434.0074146679, 90234.91638080444), (198639.4631111624, 89807.44982176385), (197758.8819995387, 88943.96737250185), (198374.4338445572, 88473.7541575572), (197895.6712984317, 88020.63960497417), (196921.0475438192, 88345.51418984502), (196536.3276406827, ...


1

Step 1: Make a Selection of the specific sub-polygon Step 2: Save your selection as a separate feature, but make sure to choose GeoJSON as your file save type


1

The error message and specifications are pretty clear: GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon. PolyhedralSurface is not in that list, so you'll need to convert it to another geometry type.


-3

towercoverage.com makes it simple. You can upload your .csv of the sites, create radio systems to add to the sites, and run actual RF propagation maps. It also has easy website integration with APIs for end user sign up and pre-qualification. The android app makes antenna alignment and path analysis simple for field technicians. We have added 22 languages ...


0

I was looking for this function too, and I have found it in some of the examples on their site. You can use ol.proj.fromLonLat([19.062072, 47.473478]). http://openlayers.org/en/v3.13.1/apidoc/ol.proj.html#.fromLonLat


2

You don't need Fiona to write a GeoJSON file features = [feat for feat in fiona.open("a_shapefile.shp") layer = { "type": "FeatureCollection", "features": features} # save json file import json #or GeoJSON with open('result.geojson', 'w') as outfile: json.dump(my_layer,outfile) No CRS is explicitly defined inside the original GeoJSON ...


0

Use qgis, http://www.qgis.org , to connect to the geojson, right click on the layer, save as, and save it as a shape file. Then you can work with it in ArcGIS Desktop. Alternatively, to work in batch mode, you can use the OSGeo4W shell that is installed with the standalone qgis installation to access the gdal/ogr toolkit to use command line ogr to convert ...


0

After a long detour to get a solution for this I finally got to the conclusion that we can't write in a file with javascript, and to do so I had to use php with AJAX


0

I was struggling with the same problem today. Finally got a solution that I am sharing here. The root of the problem is search_path of postgres database. sudo su postgres psql database_name the check out the search_path of the database database_name=# show search_path your schema that has the postgis extension should be in the search_path. To check ...


2

Things may be different from when you posted this originally. With current Mapnik versions (3.0.10 for example), this should work: <Style name="cities" filter-mode="first"> <Rule> <MarkersSymbolizer width="50" fill="#ff4455" stroke="#881133" allow-overlap="true" ignore-placement="true" /> </Rule> </Style> <Layer ...


0

Surely, the preferred answer is (1), i.e., have clients do the "right thing". A good case to consider is the polygon representing the continent of Antarctica approximated by this kml file <kml> <Folder> <name>Antarctica</name> <Placemark> <name>Antarctica</name> <Polygon> ...


2

The L.geoJson() constructor is actually just a convenient tool to convert GeoJSON data into Leaflet vector / path object(s) (like L.polyline, L.polygon, etc.). It also attaches the extra information that may be contained in the GeoJSON data into the created Leaflet objects (in layer.feature.properties for example). Therefore, if the GPS track that you ...


1

According to the answer here, Leaflet doesn't "remember" what and whether a layer was filtered, so you need to reinitialise the layer when your filter changes. Something like this... You'll need to store your data somewhere, and you'll need to call the function from your init function with the default value. (BTW if you're going to have more than two ...


7

Speaking purely from a data storage and analysis perspective, the geography type for PostGIS was designed with the antimeridian in mind (among several design goals). There are several functions specifically designed for the geography type. For instance, consider a LineString across Taveuni, Fiji (mapped with Great Circle Mapper), which straddles the ...


1

You do realize that your tutorial for "featureOver" makes you superimpose a new layer / feature above your track. Therefore, the latter can no longer be clicked on. You could either implement your "featureClick" listener on the added layer / feature as well, so that it opens your sidebar. Or you could rather change the display properties of the ...


1

Municipal ward level maps can be found here: https://github.com/mickeykedia/India-Maps


0

You can use the show() (the sublayer you have clicked on) or hide() (the rest of the sublayers) methods as explained in this tutorial.


1

Altough I wasn't able to find a bug in the above code... I managed to work it around using another way to load GeoJSON based layers. Another thing, the lat and longs weren't properly ordered in the example given (so that the correspond to positions on Rosario, Argentina)... Below are written correctly. <!DOCTYPE html> <html> <head> ...


1

Once you have your geojson back use the ol.format.GeoJSON() to parse the object and create the features. var format = new ol.format.GeoJSON(); var myGeoJsonObj = ....asign the geojson result here var myGeoJsonFeatures = format.readFeatures(myGeoJsonObj ) and then you may place your features in a vector layer using. ...


0

Clustering can help. See https://github.com/SINTEF-9012/PruneCluster Here a 50000 marker example http://sintef-9012.github.io/PruneCluster/examples/realworld.50000.html


1

I made a test with OSGeo4W version of GDAL gdalinfo --version GDAL 2.0.2, released 2016/01/26 I created a test point in OpenJUMP JML format with one decimal attribute. <?xml version='1.0' encoding='UTF-8'?> <JCSDataFile xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" > ...


4

There is a configuration switch for this in GDAL 2.1 onwards: http://www.gdal.org/drv_geojson.html It defaults to 16 decimal places. So upgrading to GDAL 2.1 should solve your issue. If not you can try a higher number of decimal for floating point numbers: -lco SIGNIFICANT_FIGURES=17


0

You can try to search on this link. It gives some explanation on how to convert gpx to shp, but in arcmap. And you can try on this link, to search for method to do it in qgis.


3

This can be done a bit more simply with json_build_object in PostgreSQL 9.4+, which lets you build up a JSON by supplying alternating key/value arguments. For example: SELECT json_build_object( 'type', 'Feature', 'id', gid, 'geometry', ST_AsGeoJSON(geom), 'properties', json_build_object( 'feat_type' : feat_type, ...


1

Natural Earth has vector data of the Earth in different resolutions. The data comes as shapefiles, but saving to another file format is an easy task for almost all GIS software. Some of them (like QGIS) are free of charge. Note that you can use the data in any scale you want, but low resolution shapes have less vertices. You could try to simplify the ...


1

SELECT ST_GeomFromText( ST_AsText( ST_GeomFromGeoJSON('YOUR GEOJSON') ), 4326)


5

Your GeoJSON sample lacks information about the coordinate reference system, although you say it is SRID 900913. This is so-called Google Mercator or Web Mercator, which has been superseded by EPSG:3857, which I will use in this example. An important question is whether you really want Well-Known Binary, which does not include an SRID, or Extended Well-Known ...


6

Use ST_GeomFromGeoJSON select ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-125045.48351212002,4577567.588141698],[-124816.19981552364,4577552.93014355],[-124765.99472517562,4577419.175847012],[-124842.47121534991,4577392.905406596],[-125045.48351212002,4577567.588141698]]]]}') Result: ...


9

Use ST_GeomFromGeoJSON. SELECT ST_GeomFromGeoJSON('{"type":"MultiPolygon","coordinates":[[[[-125045.48351212002,4577567.588141698],[-124816.19981552364,4577552.93014355],[-124765.99472517562,4577419.175847012],[-124842.47121534991,4577392.905406596],[-125045.48351212002,4577567.588141698]]]]}'); Returns: ...



Top 50 recent answers are included