coordinates

python: elegant way of finding the GPS coordinates of a circle around a certain GPS location

烈酒焚心 提交于 2019-12-03 13:23:58
I have a set of GPS coordinates in decimal notation, and I'm looking for a way to find the coordinates in a circle with variable radius around each location. Here is an example of what I need. It is a circle with 1km radius around the coordinate 47,11 . What I need is the algorithm for finding the coordinates of the circle , so I can use it in my kml file using a polygon. Ideally for python. Use the formula for "Destination point given distance and bearing from start point" here: http://www.movable-type.co.uk/scripts/latlong.html with your centre point as start point, your radius as distance,

Draw curved lines in ggmap, geom_curve not working

為{幸葍}努か 提交于 2019-12-03 13:21:00
I would like to make a map of the Netherlands with curved lines between cities. I have two dataframes number one called: df_verticles which contains 24 cities with their lat/lon combination. The second dataframe called: df i want to use to draw a curved line between lat/lon from combination to the lat/lon to combination. > head(df_vertices) city AmountSessions totalkWh AmountRFID scaledAmount scaledkWh Latitude Longitude 1 Alkmaar 13608 104554.68 1326 0.07139012 0.026941910 52.63903 4.755538 2 Almere 11281 100841.42 930 0.05006999 0.025985067 52.39447 5.282043 3 Amersfoort 7719 67663.30 1198 0

Get the mouse coordinates when clicking on canvas

﹥>﹥吖頭↗ 提交于 2019-12-03 12:43:50
A common question, but I still need help. I'm trying to get and store the mouse coordinates when someone clicks within the canvas. my HTML <canvas id="puppyCanvas" width="500" height="500" style="border:2px solid black" onclick = "storeGuess(event)"></canvas> and my javascript //setup canvas var canvasSetup = document.getElementById("puppyCanvas"); var ctx = canvasSetup.getContext("2d"); guessX = 0;//stores user's click on canvas guessY = 0;//stores user's click on canvas function storeGuess(event){ var x = event.clientX - ctx.canvas.offsetLeft; var y = event.clientY - ctx.canvas.offsetTop; /

Importing CSV File to Google Maps

感情迁移 提交于 2019-12-03 12:42:52
问题 I have an quite big CSv File I want to have in Google Maps or just on a map. These are just coordinates but I have 600.000 of them.. Do you have any Idea how I can do this? I've added an screenshot from XTabulator below: 回答1: The easiest way to do this is generate a KML file (see http://code.google.com/apis/kml/articles/csvtokml.html for a possible solution). You can then open that up in Google Maps by storing it online and linking to it from Google Maps as described at http://code.google.com

libgdx coordinate system differences between rendering and touch input

天涯浪子 提交于 2019-12-03 12:12:50
问题 I have a screen (BaseScreen implements the Screen interface) that renders a PNG image. On click of the screen, it moves the character to the position touched (for testing purposes). public class DrawingSpriteScreen extends BaseScreen { private Texture _sourceTexture = null; float x = 0, y = 0; @Override public void create() { _sourceTexture = new Texture(Gdx.files.internal("data/character.png")); } . . } During rendering of the screen, if the user touched the screen, I grab the coordinates of

Calculate if an object is inside a set of coordinates?

。_饼干妹妹 提交于 2019-12-03 11:06:36
问题 I have a set of X and Y points that builds a shape and I need to know if an object is inside it or not what is the calculation to it ? X and Y coords example: 522.56055 2389.885 544.96 2386.3406 554.18616 2369.2385 535.21814 2351.396 497.5552 2355.8396 I am not really good with math :( so i would appreciate some support to understand how it is done. Example of what I have so far but doesnt seem very reliable: private boolean isInsideShape(Zone verifyZone, Position object) { int corners =

calculating a gps coordinate given a point, bearing and distance

烈酒焚心 提交于 2019-12-03 10:17:50
问题 I have a problem which draws my back in some project for some time now. Im basically looking to trap a polygon using x,y points drawn by some script ive written. lat1,lon1 are the center gps cords of the polygon and im looking for its surrounding polygon. here is a part of my code in python: def getcords(lat1,lon1,dr,bearing): lat2=asin(sin(lat1)*cos(dr)+cos(lat1)*sin(dr)*cos(bearing)) lon2=lon1+atan2(sin(bearing)*sin(dr)*cos(lat1),cos(dr)-sin(lat1)*sin(lat2)) return [lat2,lon2] my input goes

What event is fired when MKMAPVIEW extent changes

我怕爱的太早我们不能终老 提交于 2019-12-03 08:48:45
What event is fired when the MKMAPVIEW changes extent (zooms in or out, panning)? I need to get the coordinates that are used to display the map. You should adopt the MKMapViewDelegate protocol and implement mapView:regionDidChangeAnimated: method which will be called in the event the region changes. However since it will be called many times when scrolling you should take that into consideration before implementing that method. Getting the Top-Left coordinate of the map CLLocationCoordinate2D topLeftCoordinate = [self.mapView convertPoint:CGPointMake(0,0) toCoordinateFromView:self.mapView];

Android: Find absolute click position on the ImageView after zooming (using pinch to zoom using Matrix Layout)

烂漫一生 提交于 2019-12-03 08:48:35
I am using code found in Hello Android, 3rd Edition for Pinch to Zoom functionality. After using this the pinch to zoom works fine, but after zooming i want to get the absolute click position on the image view. Here is my code package org.example.touch; import android.app.Activity; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.PointF; import android.os.Bundle; import android.util.FloatMath; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.GridView; import

Algorithm to identify a unique free polyomino (or polyomino hash)

跟風遠走 提交于 2019-12-03 08:09:10
问题 In short: How to hash a free polyomino? This could be generalized into: How to efficiently hash an arbitrary collection of 2D integer coordinates, where a set contains unique pairs of non-negative integers, and a set is considered unique if and only if no translation, rotation, or flip can map it identically to another set? For impatient readers, please note I'm fully aware of a brute force approach. I'm looking for a better way -- or a very convincing proof that no other way can exist. I'm