Tag Info

Hot answers tagged

5

First of all I suggest to use postgis function ST_SimplifyPreserveTopology instead of qgis semplification. If I understand it right you want to have a small file with an high level of detail... and thats impossibile (if you still want to use shape files). But you can do what other webgis do. You can create 2 or more shape files with different semplification ...


4

If you use custom objects and properties in your GeoJSON, they are ignored when the object is read using GeoJSON format. You can clearly see this on line 115 of the GeoJSON.js source code. Since the properties are never read in the first place, it is not possible to get them in OpenLayers. There are multiple workarounds to get what you want. You could ...


3

I would download and install QGIS, and then open the geojson file by clicking Add vector layer button: After that you should be able to see you geojson file in QGIS: And right click the layer's name in the left hand layer list, and click "Properties"; then go to the "Joins" tab, and click the green plus icon on the left bottom corner to open "Add ...


3

I figured it out so I'm posting the answer here: geojson = open('shp.json', "w", encoding='utf-8') Add encoding='utf-8' to this line while creating json file. Works great!


2

To change point markers, you should use the pointToLayer function. See the example page. var geojsonMarkerOptions = { radius: 8, fillColor: "#ff7800", color: "#000", weight: 1, opacity: 1, fillOpacity: 0.8 }; L.geoJson(someGeojsonFeature, { pointToLayer: function (feature, latlng) { return L.circleMarker(latlng, ...


2

CLU isn't available to the general public. It's considered PII now. None the less. It's doesn't cover all ground, just those involved in USDA programs. Plus, the boundaries don't always match up with what's actually going on the ground. For example, a producer decides to crop one part of a field in beans and the other in corn. The CLU boundary may not ...


2

Since HTML5 announcement flash support has dropped, and adobe has ditched flex, and now they predict that (flash, silverlight, java) will die so for the moment the future is for HTML5 and JS.


2

Your code always returns the same content or text because: var popupContent = "This is some content"; return L.circleMarker(latlng, eqstyle).bindPopup(popupContent, popupOptions); For example, in order to return the magType of a point you can replace the same text with: var popupContent = String(feature.properties.magType); return L.circleMarker(latlng, ...


1

The query is the following: "SELECT row_to_json(f) As feature \ FROM (SELECT 'Feature' As type \ ,ST_AsGeoJSON(%s)::json As geometry \ , row_to_json((SELECT l FROM (SELECT id AS feat_id) As l)) As properties \ FROM shapefile_feature As l WHERE l.id = %s ) As f;" % (geometryField, feature.pk) output: { u'geometry':{ ...


1

Ok, just found the problem : I forgot the parameter "name" in my Vector constructor... My bad


1

The definition for MGI_Austria_Lambert is straight from Esri software. It has several differences in naming conventions plus quirks in the projection/parameter names. Some of these date to older versions of the EPSG Geodetic Parameter Registry where Esri has not updated to match EPSG. Esri has one keyword for Lambert conformal conic and it's possible to ...


1

When I worked at NRCS, we used CLU layers, which followed tracts of fields. I don't see them at http://datagateway.nrcs.usda.gov/. However, if this is a serious request for data and you are willing to put some time into it, you should give your local county field office (either NRCS or FSA) a phone call. They are usually happy to help, and if you ask to talk ...


1

Converting GeoJson to numpy array seems to be much easier than trying to convert WKT to numpy array. import numpy as np import json #if your geojson is a string geoJson = json.load(geoJsonString) numpy_array = np.array(geoJson['coordinates']) and back to geojson: geoJson['coordinates'] = numpy_array.tolist() #if you are looking for string geojson ...


1

There is a bugfix relating to windows that was added to version 0.10.1 of TileMill. The bugfix may solve Linux problems too. This may be related to how node.js was installed on your computer. If you didn't know, node.js is used to run TileMill. You may have to correct the node.js installation issues to resolve the error.


1

I suppose you have been reading this http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html Here comes some sample requests which are sending queries for the demo server of Boundless but which should work similarly with your own server if you have demo layer topp:states installed. Select where STATE_NAME is Illinois ...


1

There are java bindings for GDAL/ogr - see http://gdal.org/java/ . No idea if they work on Android, though. Apparently ( https://www.google.de/search?q=gdal+on+android ) building gdal on Android is not really easy. http://sourceforge.net/projects/javashapefilere/ seems to be another option. Also ...


1

I don't think the issue is with the ST_GeomFromGeoJSON call. It's possibly the id field you have OR your table structure. Can you provide your table structure. SELECT ST_GeomFromGeoJSON('{"type":"Point","coordinates":[-48.23456,20.12345]}'); alone works fine, so doubt that is your issue. If the above query fails, then your postgis install is corrupt in ...


1

http://leafletjs.com/examples/geojson.html Filter The filter option can be used to control the visibility of GeoJSON features. To accomplish this we pass a function as the filter option. This function gets called for each feature in your GeoJSON layer, and gets passed the feature and the layer. You can then utilise the values in the feature's properties to ...


1

Here's solution in C#: private const double MinLatitude = -85.05112878; private const double MaxLatitude = 85.05112878; private const double MinLongitude = -180; private const double MaxLongitude = 180; public static Tuple<int, int> LatLongToTileXY(double latitude, double longitude, int z) { int tileX; int ...


1

Here's an example for C# for an envelope (i.e. polygon bounding box). This will grab extra tiles for irregular polygons, avoiding that will be complex. The Envelope class is this method is a MapDotNet object but it should be pretty obvious what the fields mean. /// <summary> /// Gets the quad tree node indicies. /// Returns the min x,y ...


1

I think you are approaching the problem the wrong way. You can't load a gigantic dataset and expect fast interactivity. If you've already simplified as much as you want, and it's not fast enough. Try a different technology. If you're not happy with TileJSON, use CartoDB or MapBox to to it for you, or use WMS for viewing and WFS for interactivity. Or load ...


1

Interrupting a rendering process is not possible in Leaflet since it is performed in a single atomic JS job (AFAIK). The only way to make your app more responsive to user interactions might be to boost the rendering process so that it completes faster. Simplifying the geometries (or using topojson) is an excellent first solution for that. Another one could ...


1

I'd suggest you divide the problem into two parts: Generate a set of squares that represent the bounding boxes of each polygon ensuring they don't intersect. one way to do this would be generate a set of random points (1 per polygon) Put the first point into your master boundary. For each subsequent point, subdivide the box mid way along the closest axis ...



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