geojson

Insert/Update PostGis Geometry with Sequelize ORM

我与影子孤独终老i 提交于 2019-12-04 06:48:15
I have extracted models of some PostGis layers with sequelize-auto, giving: module.exports = function(sequelize, DataTypes) { return sequelize.define('table', { id: { type: DataTypes.INTEGER, allowNull: false, primaryKey: true, autoIncrement: true }, geom: { type: DataTypes.GEOMETRY('POINT', 4326), allowNull: true, }, ... On GET sequelize sends the geom to the client as GeoJSON: { "type":"Point", "coordinates":[11.92164103734465,57.67219297300486] } When I try to save this back PosGis errors with: ERROR: Geometry SRID (0) does not match column SRID (4326) This answer gives a god indication of

Google map waypoints from geoJSON

。_饼干妹妹 提交于 2019-12-04 06:15:01
问题 I want to load an itinerary from a geoJSON file. For the moment, it works, but only with two points. But I need to add 4 or 5 waypoints. My code only read the two first points and set them as Origin and destination. Here's my code google.maps.event.addListener(map.data, 'addfeature', function (e) { if (e.feature.getGeometry().getType() === 'Point') { map.setCenter(e.feature.getGeometry().get()); if (!origin) origin = e.feature.getGeometry().get(); //if origin does not exist else if (

Draw lines between markers in leaflet

旧时模样 提交于 2019-12-04 00:03:50
I'm trying to insert lines between markers (which are generated from JSON data) in leaflet. I saw an example, but it doesn't work with JSON data. I can see the markers, but no lines appear. var style = { color: 'red', fillColor: "#ff7800", opacity: 1.0, fillOpacity: 0.8, weight: 2 }; $.getJSON('./server?id_dispositivo=' + id_device + '', function(data) { window.geojson = L.geoJson(data, { onEachFeature: function (feature, layer) { var Icon = L.icon({ iconUrl: './images/mymarker.png', iconSize: [18, 28], // size of the icon style: style, }); layer.setIcon(Icon); layer.bindPopup(feature

how make ng-model=“search” have influence on leaflet directive?

ぐ巨炮叔叔 提交于 2019-12-03 22:39:10
问题 I use leaflet-angular-directive, i successfully display objects in table and map, although i achieved filtering through searching input only affect geojson objects in table. My aim: make filtering through searching input affect geojson objects in table and map. My Module var AppMapDirectory = angular.module('DirectoryAppMap', ['ngResource', 'leaflet- directive']); My Factory AppMapDirectory.factory("Directory", function($resource) { return $resource("json/result.json", {}, { get: { method:

Search all polygons that contains a series of points in mongodb

依然范特西╮ 提交于 2019-12-03 20:28:58
My question is similar to this one Given a set of polygons and a series of points, find the which polygons are the points located I have a mongodb database with two collections, regions that stores a set of polygons (italy provinces), and points that stores a set of specimens each with a coordinate pair. I am using mongodb 2.4 and GeoJSON format to store data, both collections have a 2dsphere index. I am able to find if a given point is inside a given polygon. Now I would like to find all polygons that contains a list of specimens, to draw a map like this one http://www.peerates.org/province

How to read external GeoJSON file from openlayers?

ⅰ亾dé卋堺 提交于 2019-12-03 16:55:34
问题 I have to draw some lines by OpenLayers. The line features are coded as GeoJSON format. My code is ok for hard coded GeoJSON features. But, if I put this features in separate file and try to load it. It just does not work. I do not know what is the wrong with my loading external GeoJSON file. I have given both the code. Code 1: // This code is ok with hard coded GeoJSON features map.addControl(new OpenLayers.Control.LayerSwitcher()); vectorLayer = new OpenLayers.Layer.Vector("Lines"); var

How to draw GeoJSON in Apple Maps as overlay using Swift 3

Deadly 提交于 2019-12-03 16:27:39
I am trying to draw the following GeoJSON data as an overaly in MKMapView. The GeoJSON File is as below. { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "Name": "line1" }, "geometry": { "type": "LineString", "coordinates": [ [ 76.35498046875, 25.145284610685064 ], [ 81.36474609375, 25.06569718553588 ], [ 83.91357421875, 23.301901124188877 ], [ 82.001953125, 22.004174972902003 ], [ 78.33251953125, 21.248422235627014 ], [ 76.31103515625, 21.268899719967695 ] ] } }, { "type": "Feature", "properties": { "Name": "point8" }, "geometry": { "type": "Point",

Format GeoJson LineString to Dashed

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This is my GeoJson : { "type" : "FeatureCollection", "created" : "2014/07/08 03:00:55 GMT", "announced_date" : "2017/07/10 03:00:55 GMT", "features" : [{ "type" : "Feature", "properties" : { "name" : "n18", "analized_date" : "2013/07/08 10:00:00 GMT" }, "geometry" : { "type" : "GeometryCollection", "geometries" : [{ "type" : "Point", "coordinates" : [134.7, 37.3] }, { "type" : "LineString", "coordinates" : [[134.7, 37.3], [134.6, 37.1]] } ] } }] } I can display it in normal line but I want display as dashed line . I google and there is a way

Unable to trigger geojson marker over a google-map android

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm showing a geojson file as a layer over a google map android app. Everything works ok, but I'm not be able to trigger on click in geojson markers. I have adapted the code in: https://github.com/googlemaps/android-maps-utils/blob/master/demo/src/com/google/maps/android/utils/demo/GeoJsonDemoActivity.java but in line 142: layer.setOnFeatureClickListener(new GeoJsonLayer.GeoJsonOnFeatureClickListener() { I get: cannot resolve method 'setOnFeatureClickListener()' This is my code in onPostExecute; @Override protected void onPostExecute

Plot colored polygons with geodataframe in folium

天涯浪子 提交于 2019-12-03 10:20:01
问题 I'm trying to plot radar data in folium, and I'm almost there. I followed this example (Contour plot data (lat,lon,value) within boundaries and export GeoJSON) to get my data into a GeoJson format. nb_class = 20 collec_poly = plt.contourf(lons,lats,np.array(poshdata), nb_class,alpha=0.5) gdf = collec_to_gdf(collec_poly) # From link above gdf.to_json() colors = [p.get_facecolor().tolist()[0] for p in collec_poly.collections] gdf['RGBA'] = colors gdf This outputs two columns: geometry and RGBA.