New answers tagged

1

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.


2

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 ...


0

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: ...


7

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: ...


0

I couldn't find a library, but I coded up a solution that fit my requirements to handle polygons only. The code is provided below for anyone else who might find it useful. ConvertGeoJsonToKml generates complete KML and ConvertGeoJsonToKmlGeometryOnly generates a cut down KML output suitable for use in Google Fusion Tables. using ArcGIS.ServiceModel.Common; ...


2

Here an example with ST_GeomFromGeoJSON() : select ST_GeomFromGeoJSON ('{"type":"Polygon", "coordinates": [[-74.54635620117188,40.773261878622634], [-74.69741821289062,40.61082491956405], [-74.30740356445312,40.61603737424185], ...


1

To read various file formats for rendering GeoTools uses a DataStoreFinder mechanism that allows you to call it with a Map of keys & parameters and then it searches all the available DataStoreFactories to see which one can process those parameters. For your file based stores all you need to do is: HashMap<String, Object> params = ...


1

Mapbox's togeojson converter handles this very nicely. It flattens the contents of all layers/folders into sibling features. A bonus: unlike the accepted answer using ogr2ogr to extract each layer/folder, togeojson preserves features in the top-level, and not in any directory. Since it's JavaScript, it can run in your browser at ...


0

The points appear as billboards by default. You can change them to points with the following code: var entities = dataSource.entities.values; for (var i = 0; i < entities.length; i++) { var entity = entities[i]; entity.billboard = undefined; entity.point = new Cesium.PointGraphics({ color: Cesium.Color.fromRandom(), ...


4

The L.GeoJson class has a built in filter option that you can use to filter your data. Just pass it a function that will return true for the features you want to show: var picnic_parks = L.geoJson(myJson, {filter: picnicFilter}).addTo(map); function picnicFilter(feature) { if (feature.properties.Picnic === "Yes") return true } Here is a fiddle with a ...


0

It depends on the data in the graph file. In order to include or exclude road types modify the osm2po.config file. See this thread. It's a similar question for bike routing But dont use maxSpeedOverrides anymore, it's deprecated in newer versions of osm2po.


1

The geojson layer is in EPSG:4326, not 3857. For the center_coord, you should reproject the degree values to EPSG:900913: new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());


0

This looks like a projection issue. Your GeoJSON is showing units in degrees longitude and latitude: {"type":"MultiPoint", "coordinates":[[-33.015055,-60.655964],[-32.940781,-60.636731],[-32.917201,-60.683852]] }; The default GeoJSON CRS is a geographic coordinate reference system, using the WGS84 datum, and with longitude and latitude units of ...


2

One option is to use Proj4Leaflet to read the projected GeoJSON. If you have a variable called sampleProjected referencing your GeoJSON (and assuming you are using a projection that is defined in Proj4, as EPSG:3857 is), you could just add it like so: L.Proj.geoJson(sampleProjected).addTo(map); Here is an example comparing your projected data (in blue) ...


2

The shapefile's .prj file does not contain the datum shift parameters from Amersfoort to WGS84, because the ESRI world handles datum shifts differently from the GDAL world. GDAL tries to make a guess about the EPSG code, but sometimes fails. So you have to add explicitely that you have EPSG:28992 data: ogr2ogr -f GeoJSON gem_rd.geojson Gem_2015.shp -t_srs ...


0

I found the solution here (which is to use the correct srs): http://forum.openstreetmap.org/viewtopic.php?pid=163623#p163623 The correct srs (which i saved at rd.srs): +title=Amersfoort/Amersfoort +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.999908 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs ...


0

I'm not completely sure, but when reading the ogr2ogr documentation, the -clipdst and -clipdstsql seems to relate to destination data object and therefore might not be relevant to this operation. Is there a reason why you chose those variables? I would suggest using the following syntax (untested): ogr2ogr -f GeoJSON ./test-buildings.geojson ...


1

You can do that with CartoDB.js. Here you have a working example with a layer selector using buttoms and here another one using a dropdown menu. Applying the first example (where fields is the table, type is the column with two categories -outdoor and indoor-) to your needs. You should first create a div like this: <div id='layer_selector'> ...


2

The invalid GeoJSON object error appears to be a product of your edited code, where the temp variable is actually a string, not a GeoJSON object. From your sample output in the comments, it appears that you are getting an array of GeoJson Polygon objects, which L.geoJson can interpret correctly, so your original code (before the edit) should successfully add ...



Top 50 recent answers are included