geojson

Convert svg to geojson fails with ogr2ogr

夙愿已清 提交于 2019-12-12 13:25:02
问题 I've downloaded an .svg map of Finland from http://www.amcharts.com/svg-maps/?map=finland I want to convert it to topojson to use it with d3.js. I first start with svg to geojson conversion, but it fails. I tried: ogr2ogr -f "GeoJSON" finland_kunta.json finlandHigh.svg The error I get: FAILURE: Unable to open datasource `finlandHigh.svg' with the following drivers. -> ESRI Shapefile -> MapInfo File -> UK .NTF -> SDTS -> TIGER -> S57 -> DGN -> VRT -> REC -> Memory -> BNA -> CSV -> GML -> GPX -

convert geoJson data to sql server spatial data type (GIS)

╄→гoц情女王★ 提交于 2019-12-12 12:56:51
问题 I've downloaded from openstreetmaps administrative borders (city, region, country, etc...) in geoJson format. I'm trying to store the json data related to the polygons in my ms sql server using spatial data. Since I've never parsed such a complex json file I've got difficulties in manually creating a c# object to store the parsed data. I'm using newtonsoftJson.json, to read the geoJson file and create an object. Then I use reflection to get the properties related to the object. This is quite

Convert Kml with multiple features to Geojson

谁说我不能喝 提交于 2019-12-12 11:23:19
问题 I use this code to convert a kml file with a single feature to a GeoJson file. String kmlToGeoJson(String fileName) throws IOException, ParserConfigurationException, SAXException, XMLStreamException { FileInputStream reader = new FileInputStream(fileName); PullParser parser = new PullParser(new KMLConfiguration(),reader, SimpleFeature.class); FeatureJSON fjson = new FeatureJSON(); FileWriter tmp = new FileWriter(fileName + ".geojson"); BufferedWriter writer = new BufferedWriter(tmp);

Bangalore geojson map with d3 js

时光怂恿深爱的人放手 提交于 2019-12-12 08:59:18
问题 Am trying to use a Bangalore geojson file with 8 zones (features) in it by using d3.js The map is not showing up properly. What's wrong here. ?? <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>D3: expr maps</title> <script type="text/javascript" src="d3/d3.min.js"></script> <style type="text/css"> /* No style rules here yet */ </style> </head> <body> <script type="text/javascript"> //Width and height var width = 500; var height = 300; var vis = d3.select("body").append(

Google Maps API draw a text from GeoJSON point geometry

烂漫一生 提交于 2019-12-12 03:15:21
问题 I've got geoJSON data like this: { "type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"text": "Street Foo", "Font": "25", "Angle": "0.99999"}, "geometry":{"type":"Point", "coordinates":[44.4878559081156,9.76673954155489]}} ] } I would like to draw a text "Street Foo" with Font size 25 and 0.999 radiant angle inclination with Google Maps API. I tried this: var mapOptions = { zoom: 14, center: new google.maps.LatLng(44.4878559081156,9.76673954155489), mapTypeId: google

Leaflet GeoJSON zoom to marker by id

℡╲_俬逩灬. 提交于 2019-12-12 02:59:45
问题 I have a GeoJSON with multiple markers which are placed on the map. Now I would like to set the view from map to one of this markers, by its id. var map = L.map('map'); var osm = L.tileLayer('http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>' }); var geojsonFeature = [{ "type":

Mongoose geospatial search: distance not working

╄→尐↘猪︶ㄣ 提交于 2019-12-12 02:59:19
问题 I was playing around with mongoose and geospatial search and after following tutorials and reading stuff on here, I still couldn't ge my head around the problem. My schema: var mongoose = require("mongoose"); var Schema = mongoose.Schema; var LocationSchema = new Schema({ name: String, loc: { type: [Number], // [<longitude>, <latitude>] index: '2dsphere' // create the geospatial index } }); module.exports = mongoose.model('Location', LocationSchema); My (POST) route: router.post('/', function

Near operator for geojson point returning error when maxdistance is used in query

最后都变了- 提交于 2019-12-12 02:43:20
问题 I am trying to store some geojson points in mongo db.Here is the mongoose schema I have defined. new mongoose.Schema({ itemName:String, loc:{ type: [Number], index: '2dsphere'} }); Next I am trying to run a near operator to find out some points nearby.This is how I have defined the near query. Model.where('loc').near({ center: { type:"Point",coordinates: [10,10] }, maxDistance: 20 }).exec(function(err,data){ console.log(err); if (!err && data) { console.log("Success"); } else { console.log(

Importing GeoJSON into leaflet with coordinates n CRS epsg:3857

大憨熊 提交于 2019-12-12 01:44:24
问题 Please bear with me as I am fairly new to this whole maps things I have a geojson file with the coordinates given in the epsg:3857 format {"name":"2011","type":"FeatureCollection" ,"crs":{"type":"name","properties":{"name":"EPSG:3857"}} ,"features":[{ "type":"Feature", "geometry": {"type":"Polygon", "coordinates":[[[16455748.301877,-4074559.33797376],[16455757.520912,-4074683.80559603],[16455834.5041285,-4074749.65646613]]]}, "properties":{"CODE":"LGA12200","LGA_NAME":"Cootamundra (A)","STATE

AJAX and Leaflet: Inspect feature properties before styling/adding to map

大城市里の小女人 提交于 2019-12-12 01:25:18
问题 I'm using leaflet-ajax to load geoJSON on demand. I want to find the maximum theProperty value so I can use that to scale the feature's fill colors before I add them to the map. Here's my general approach: function maxBinPropertyValue(theProperty) { var theGeoJson = null; var maxPropertyValue = 0; var propertyValue = null; var theGeoJson = new L.GeoJSON.AJAX(binsFileName()); theGeoJson.on('data:loaded', function() { console.log('The data is loaded'); theGeoJson.eachLayer(function(layer) {