Tag Info

New answers tagged

2

Your question is rather broad, but from what you say, the best format would be GeoJSON. OpenLayers, Leaflet and Google Maps all read and display GeoJSON, with a trivial amount of coding required. Here is the Open Layers 3 GeoJSON example. OpenLayers 2 and 3 also have (Geo)JSON writers, which allow you to serialize OpenLayers vector objects back to JSON for ...


2

After some debugging on client side, your issue is that you define key_on="feature.properties.PCON13NM.geometry.type.Polygon", whereas it should be key_on="feature.properties.PCON13NM", Another big issue is the fact that your geometries are too big whereas you only need some geometries to display. Just for info, your GeoJSON is "only" 20Mb (your browser ...


2

You might want to look at Metro Extracts: https://mapzen.com/metro-extracts/ You can download updated (weekly) shapefiles of OSM features for many metro areas all over the globe, as .shp or GeoJSON. From there, you can drop it into QGIS or some other desktop GIS and apply the appropriate definition query, to get the bicycling layer. This should get you ...


2

There are two broad ways to do this - one is to piggyback on someone else's infrastructure. For instance, the overpass turbo api has a query already baked in to get cycle routes and this can be exported as geojson (see "load" tab). This is great for one-off queries and where you have a small amount of data, but you are reliant on the generosity of others so ...


0

If you have a well made road graph shape (with from and to nodes), you can use my qgis processing scripts at https://github.com/chourmo/QGIS-Transit-tools For batch starting points, use Shortest-times car If you want to find times from start to end, make a lines files and use Shortest-path car


1

The GeoJson you link to is valid See by yourself http://jsfiddle.net/FranceImage/pcqsne4z/ L.geoJson(getData(), { onEachFeature: handleFeature } ).addTo(map); function getData() { return { "type": "FeatureCollection", ... ... "geometry": { "type": "LineString", "coordinates": [ [-1.0950612, ...


1

Try parsing the JSON like this: var json = { "st_asgeojson": { "type":"LineString", "coordinates":[ [23.4582348,37.5062675], [23.4577141,37.5066109], [23.4572601,37.5070038], [23.4566746,37.507301], [23.455698,37.5076256], [23.4549737,37.5079214], ...


1

You prepare an empty table with an id <table id="properties"></table> And you populate it with innerHTML property for (var prop in properties) { if (properties.hasOwnProperty(prop)) { document.getElementById("properties").innerHTML = document.getElementById("properties").innerHTML + "<tr><td>" + prop + ...


0

Personnally, I need more input. I maybe misunderstand but it seems to works: I mean I see your geoJSON properties within the data and attributes keys with the values in the debugger complete. I use below code in Firebug at http://dev.openlayers.org/releases/OpenLayers-2.12/examples/draw-feature.html var featuresText = ...


2

After looking in the API docs at http://openlayers.org/en/v3.0.0/apidoc/ol.source.GeoJSON.html and unchecking the checkbox Stable Only on the top right of the banner, I see a projection option for the source. It's here you have to set the projection to say to OpenLayers 3 to transform the data coordinates. Trying changing your fiddle with below part, it ...


0

There is a good answer in Google Groups by Nelson Minar: Use experimental plugin by Ziggy Jonsson and Nelson Minar that renders GeoJSON with D3: https://github.com/NelsonMinar/vector-river-map/blob/master/clients/lib/TileLayer.d3_geoJSON.js Nicklas Aven recommends TKWB binary format that is 80% more effective bandwidth-wise. There is another D3+Leaflet ...


0

I would suggest Grass GIS. The v.net package is a pretty powerful tool. Grass can be a bit tricky to get going on but with a tutorial or two you should be OK. You will also need to interpret the matrix result that will be ~200 by ~200 with the distances. Export to excel, import with Python, etc. and do what needs doing with it. ...


3

In your code, myLines is not a geojson structure ... Try with this syntax { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "type": "LineString", "coordinates": [[42.438917, -71.116146],[42.443904, -71.122044]] } }, { "type": "Feature", ...


0

Have you tried to explicitly reproject your data using ol.proj.transform? For example: var map_centre = ol.proj.transform([lon, lat], 'EPSG:4326', 'EPSG:3857');


1

You could do this using Javascript Topology Suite which will work with Node.js. Start with an empty MultiPolygon (or the first geometry in your collection) and union this with each (Multi)Polygon in your collection. You can only have one format for the whole collection, obviously, as properties are one to one with the geometry in the GeoJSON. Here are some ...


1

Geojsonlint seems to suppose that GeoJSON is in WGS84 coordinate system which is also the only officially supported CRS in the newest GeoJSON specification (draft) https://tools.ietf.org/html/draft-butler-geojson-04 I converted your GeoJSON into epsg:4326 with ogr2ogr by using command ogr2ogr -f geojson -s_srs epsg:3857 -t_srs epsg:4326 geojsontest2.json ...


1

You could use a spatial database (like PostGIS). First, you put all your addresses in a table "addresses" with a column "Point" of type Point and a column "Address". CREATE TABLE addresses (Point Point, Address Varchar(50)); Then you put your polygon in another table, let's call it "poly". It can have a column "Polygon" of type Polygon and another column ...


1

I got it : I just deleted onPopupClose from popup definition in function monpopup(event). Now white cross does its job


3

I use Leaflet with SVGs as the maps. I do this because I want the map functionality on top of a floor plan. In my experience, it works much better than Raphael.js (maybe just because it's newer?), which my company used for the same purpose on a previous project. I have also made map tiles out of floor plans, but the SVGs are faster and smoother when zooming ...


0

create your overlay offline(but dynamically) using the programming language of your choosing. it'll be a bit complex but the basic pseudo code would be: browser javascript send request url for overlay acquire gis bounds for tile server side gather all points and sort by their relevance create image(transparent) for each point: (least relevant first) draw ...


1

Unfortunately this is a custom JSON format (and not GeoJSON), so I don't see any other option than reformat these data, which requires some coding: You can reformat it to conform GeoJSON (or any other format which is readable by OGR) and use v.in.ogr. Or you can reformat it to GRASS ASCII format and import the point data with v.in.ascii, see example 3.


0

Check out the stringDivider method in the source code for this example: http://openlayers.org/en/v3.0.0/examples/vector-labels.html


1

Reproject from Web Mercator, for example to WGS84 ogr2ogr -f GeoJson 050_00wgs84.gjson 050_00.shp -s_srs EPSG:3857 -t_srs EPSG:4326 topojson --id-property=GEO_ID -o 050_00wgs84.json -- 050_00wgs84.gjson Then: var width = 800, height = 800; var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); ...


0

Although I can't see any specific documentation, it appears that once a column type is set in CartoDB subsequent refreshes to the same table do not unset the column type. So even though we're still getting "string" columns from Fulcrum, those columns are updated in CartoDB without changing the column types assigned in CartoDB.



Top 50 recent answers are included