## Create a unique legend based on a contingency (2x2) table in geom_map or ggplot2?

How can I do this based on this contingency table? I'm not entirely sure how to create a custom legend in R based on the indicator table I made (crimes). Reproducible code in R: require(maps) set.seed(123) # randomly assign 2 variable...
more »

2017-09-05 23:09 (2) Answers

## Create choropleth map from coordinate points

I have a data frame consisting of multiple data points with specific geocoordinates (latitude and longitude). I'm looking to create a choropleth-style world map where geographical regions are shaded according to how many data points fall within the b...
more »

2017-08-26 03:08 (1) Answers

## How to calculate 3D distance (including altitude) between two points in GeoDjango

Prologue: This is a question arising often in SO: 3d distance calculations with GeoDjango Calculating distance between two points using latitude longitude and altitude (elevation) Distance between two 3D point in geodjango (postgis) I wanted to ...
more »

2017-08-10 18:08 (2) Answers

## Great circles Map within a country in R

I am working on a commuter travel Pattern (Origin - Destination) Flow Map in R. The Data i have is daily transaction of commuters (Date,Card,Entry_lat,Entry_Long,Exit_Lat,Exit_Long). The Travel Path might be similar (as they commute to work). I nee...
more »

2017-06-02 14:06 (1) Answers

## r raster cover function - error with landsat stacks

I'm running into an unusual issue with the cover function in R. We are trying to fill cloudy pixels with values from another layer. I can make it work just fine with stacks as follows - library(raster) r1 <- raster(ncols=36, nrows=18) r1[] <- ...
more »

2017-06-01 00:06 (1) Answers

## Flow map(Travel Path) Using Lat and Long in R

I am trying to plot flow map (for singapore) . I have Entry(Lat,Long) and Exit (Lat,long). I am trying to map the flow from entry to exit in singapore map. structure(list(token_id = c(1.12374e+19, 1.12374e+19, 1.81313e+19, 1.85075e+19, 1.30752e+19,...
more »

2017-05-31 13:05 (4) Answers

## How to add a temporary field for calculation in django model?

I am developing a GIS based django app in which i am allocating the nearest exam center to a student based on his current location. I have my centre model like this class Center(models.Model): name = models.CharField(max_length=500) city = ...
more »

2017-03-25 18:03 (1) Answers

## Does SQL Server support measuring distance via routes?

I've been experimenting with SQL Server spatial functions and seen that the STDistance method allows you to determine the distance between two geometries. Is there any functionality that allows you to measure distance between two points via roads, li...
more »

2017-01-17 23:01 (0) Answers

## Convert GeoJSON polygon to point before drawing in Leaflet Map

I have a GeoJSON dataset which has points and polygons. I have a simple Leaflet code which reads them into a map, like this: var MyLayer = new L.GeoJSON.AJAX("/UrbanSyntax/Desarrollo/twitter /data/boxtest.json", { pointToLayer: function(feature,...
more »

2017-01-15 18:01 (2) Answers

## How can calculate the real distance between two points with GeoDjango?

from django.contrib.gis.geos import Point p1 = Point(36.74851779201058, -6.429006806692149, srid=4326) p2 = Point(37.03254161520977, -8.98366068931684, srid=4326) p1.distance(p2) Out: 2.5703941316759376 But what is the unit of this float number? ...
more »

2016-08-29 19:08 (4) Answers

## Querying json in postgres

I have to extract data from a json file who contains spatial information. The content of this file is {"vertices":[{"lat":46.744628268759314,"lon":6.569952920654968}, {"lat":46.74441692818192,"lon":6.570487107359068}, {"lat":46.744...
more »

2016-08-25 08:08 (1) Answers

## Avoiding hoizontal lines and crazy shapes when plotting maps in ggplot2

I want a plot of an area, such as Latin America, using the world shape file from IPUMSI... https://international.ipums.org/international/resources/gis/IPUMSI_world.zip ... I will add some more IPUMS districts later so I really want to use this as m...
more »

2016-08-09 16:08 (2) Answers

## Unable to get the location bound of Sketchup model using Sketchup Ruby API

I have a Sketchup 3d model that is geo-located. I can get the geo-location of the model as follows :- latitude = Sketchup.active_model.attribute_dictionaries["GeoReference"]["Latitude"] longitude = Sketchup.active_model.attribute_dictionaries["GeoR...
more »

2016-06-30 13:06 (1) Answers

## r: tearing when plotting polygons with holes in ggplot2

I'm trying to plot these body maps and can't get the face to show correctly. The "heads" are made up of two polygons: one is the face (solid oval) and...
more »

2015-12-05 08:12 (0) Answers