coordinates

Django - GeoDjango read coordinates in the wrong order

[亡魂溺海] 提交于 2020-06-26 12:25:27
问题 first of all thanks for your help. I'm making a form with Django which uses the OSMWidget to save coordinates (Polygons, Lines and Points) to a Geometry field in a PostgreSQL database. It works well, I can save the information in the database without any problem. And when I make a query with PgAdmin I can see the geometric fields data displayed in a Leaflet map correctly. . Here's some of what I have in my forms.py: from django import forms from django_select2 import forms as select2_forms

Django - GeoDjango read coordinates in the wrong order

[亡魂溺海] 提交于 2020-06-26 12:25:13
问题 first of all thanks for your help. I'm making a form with Django which uses the OSMWidget to save coordinates (Polygons, Lines and Points) to a Geometry field in a PostgreSQL database. It works well, I can save the information in the database without any problem. And when I make a query with PgAdmin I can see the geometric fields data displayed in a Leaflet map correctly. . Here's some of what I have in my forms.py: from django import forms from django_select2 import forms as select2_forms

Leaflet: how to swap coordinates received from an ajax call

大兔子大兔子 提交于 2020-06-25 07:08:35
问题 I am using Leaflet 1.0.3 and a few plugins including Leaflet.ajax. My L.geo.ajax call is working and returning geojson objects, however, the coordinates are reversed. I created a function to fix this: var convertLatLng = function (latlng) { var temp = latlng[y]; latlng[y] = latlng[x]; latlng[x] = temp; convertedLatLng = latlng; return convertedLatLng; console.log('this function is running') } But my problem is I don't know where to put it. Do I run it inside my geoJson call? If so, where?

How to find bounding boxes coordinates in Tensorflow Object Detection API

假如想象 提交于 2020-06-17 00:51:06
问题 I'm using Tensorflow object detection API code. I trained my model and got great detection percentages. I have been trying to get the bounding boxes coordinates but it keeps on printing out a list of 100 bizarre arrays. after a wide search online I found out what the numbers in the arrays meant (The bounding box coordinates are floats in [0.0, 1.0] relative to the width and height of the underlying image.) But still, my arrays are very different than the ones shown in examples online. Another

Convert Multiple Addresses to Coordinates in Swift - IOS

僤鯓⒐⒋嵵緔 提交于 2020-06-01 05:12:14
问题 I used this to be able to view one address at a time. Convert address to coordinates swift However, I would like to view an array of addresses (131) and their respective coordinates Here is my code: func convertAddressToCoordinates() { for address in addresses { geocoder.geocodeAddressString(address) { placemarks, error in let placemark = placemarks?.first let lat = placemark?.location!.coordinate.latitude let lon = placemark?.location!.coordinate.longitude print("\(address): Lat: \(lat!),

How to find the shortest path between two coordinates in a 2-dimensional array?

安稳与你 提交于 2020-05-30 04:18:09
问题 I am trying to find the shortest way to get from one point in a 2D array (one coordinate with x and y values representing its position in the array) to another. I would like to output an array of coordinates which must be travelled through to get from the initial to the final coordinates. One example of an array like this could be arr = [ [15, 7, 3], [1, 2, 6], [7, 4, 67] ] In this case, we can say that we will begin at arr[0][0] and end at arr[2][2] . Thus, the coordinates would be (0, 0)

Find lat/lon within a radius from a known centered point in R

断了今生、忘了曾经 提交于 2020-05-11 03:25:21
问题 I have a known point (centre) with known latitude and longitude and I have some coordinates (in lat/lon) in a df and I want to see which ones are within a radius of 5km or less from the centre point. Centre mylon <- c(-2.106472) mylat <- c(57.14455) Coordinates longitude latitude [1,] -2.141177 57.16278 [2,] -2.090960 57.18079 [3,] -2.118894 57.12292 [4,] -2.140090 57.13763 [5,] -2.113988 57.13855 [6,] -2.123892 57.13585 [7,] -2.144685 57.17207 [8,] -2.220046 57.19150 [9,] -2.114343 57.09301

Find lat/lon within a radius from a known centered point in R

送分小仙女□ 提交于 2020-05-11 03:24:07
问题 I have a known point (centre) with known latitude and longitude and I have some coordinates (in lat/lon) in a df and I want to see which ones are within a radius of 5km or less from the centre point. Centre mylon <- c(-2.106472) mylat <- c(57.14455) Coordinates longitude latitude [1,] -2.141177 57.16278 [2,] -2.090960 57.18079 [3,] -2.118894 57.12292 [4,] -2.140090 57.13763 [5,] -2.113988 57.13855 [6,] -2.123892 57.13585 [7,] -2.144685 57.17207 [8,] -2.220046 57.19150 [9,] -2.114343 57.09301

Find lat/lon within a radius from a known centered point in R

我的未来我决定 提交于 2020-05-11 03:23:08
问题 I have a known point (centre) with known latitude and longitude and I have some coordinates (in lat/lon) in a df and I want to see which ones are within a radius of 5km or less from the centre point. Centre mylon <- c(-2.106472) mylat <- c(57.14455) Coordinates longitude latitude [1,] -2.141177 57.16278 [2,] -2.090960 57.18079 [3,] -2.118894 57.12292 [4,] -2.140090 57.13763 [5,] -2.113988 57.13855 [6,] -2.123892 57.13585 [7,] -2.144685 57.17207 [8,] -2.220046 57.19150 [9,] -2.114343 57.09301

R: over-write xy coordinates of raster layer

人走茶凉 提交于 2020-05-09 04:44:29
问题 I have a raster with XY pixel coordinates which I want to convert to lat and long. class : RasterLayer dimensions : 1617, 1596, 2580732 (nrow, ncol, ncell) resolution : 1, 1 (x, y) extent : 0, 1596, 0, 1617 (xmin, xmax, ymin, ymax) coord. ref. : NA data source : C:\janW1.png names : janW1 values : 0, 255 (min, max) I have calculated the lat/long coords using the formula specified here. This has resulted in the following dataframe heads(cords) lat lon x y janW1 1 46.99401 -14.99122 0.5 1616.5