gouchangjiang / opengeoda

Automatically exported from code.google.com/p/opengeoda
GNU General Public License v3.0
0 stars 0 forks source link

Thiessen polygons: Bug #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Richard Plant to openspace-list, 29 Jan 2009: I am having a problem in
attempting to create a Thiessen polygon shapefile based on a point data set
that is almost but not quite rectangular in shape. The following toy data
set illustrates the issue. When I run the code below and use
Tools->Shape->Points to Polygon in GeoDa, I get a shapefile with a correct
set of Thiessen polygons.

library(maptools)

rect.1 <- expand.grid(1:7,9:6) # This works

rect.2 <- expand.grid(1:6,5:1)

names(rect.1) <- c("x","y")

names(rect.2) <- c("x","y")

figure <- rbind(rect.1,rect.2)

figure$ID <- 1:nrow(figure)

coordinates(figure) <- c("x","y")

plot(figure) # Check that it looks right

writePointsShape(figure,"geodatest")

When I change the first line of code to add one more row to the north end
of the rectangle, the resulting Thiessen polygon shapefile produced by
GeoDa is not correct.

rect.1 <- expand.grid(1:7,10:6) # This doesn't work

If I export the data as a csv file and create the point shape file in
GeoDa, I get the same incorrect result. I can get the correct result by
opening the same shapefile in ArcGIS and using the contributed script
“Create Thiessen Polygons.” However, I would prefer to figure out how to do
it using R and GeoDa, i.e., to find out what I am doing wrong.

I am using R 2.8.1 and GeoDa 0.9.5-i under Windows. Any help with this will
be much appreciated. 

Additional info on the shapefile:

There are 7 shapefiles. The files geodayes and geodano are the fake data
files that respectively do and don't work, and I have included the Thiessen
polygon files I get. The file f1-1data is the real file I am working with,
and f1-1bdry is the boundary polygon. The file f1-1thsn is the resulting
Thiessen polygon file.

Original issue reported on code.google.com by mmcc...@gmail.com on 9 Sep 2009 at 7:50

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mmcc...@gmail.com on 9 Sep 2009 at 7:50

GoogleCodeExporter commented 9 years ago

Original comment by mmcc...@gmail.com on 29 Nov 2010 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by jkoschin...@gmail.com on 4 Dec 2010 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by jkoschin...@gmail.com on 4 Dec 2010 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by jkoschin...@gmail.com on 4 Dec 2010 at 1:09

GoogleCodeExporter commented 9 years ago

Original comment by mmcc...@gmail.com on 17 Oct 2011 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by mmcc...@gmail.com on 17 Oct 2011 at 8:53

GoogleCodeExporter commented 9 years ago

Original comment by mmcc...@gmail.com on 17 Oct 2011 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by jkoschin...@gmail.com on 17 Aug 2012 at 6:34

GoogleCodeExporter commented 9 years ago
Solved in OpenGeoDa 1.3.4.  Email sent to original bug reporter.

Original comment by mmcc...@gmail.com on 14 Sep 2012 at 4:11