Skip to main content
Tweeted twitter.com/#!/StackGIS/status/427203270244061184
deleted 4 characters in body; edited tags
Source Link
Chad Cooper
  • 12.8k
  • 4
  • 48
  • 88
deleted 14 characters in body
Source Link
kuch nahi
  • 403
  • 2
  • 5
  • 9

To make it even clearer that this is wrong, consider this:

>>> shape.contains(shapely.geometry.Point(shapefile_record['properties']['Latitude'],shapefile_record['properties']['Longitude'])) False 

This means that latitude and longitude that define a polygon in its shapefile are not in the polygon?

To make it even clearer that this is wrong, consider this:

>>> shape.contains(shapely.geometry.Point(shapefile_record['properties']['Latitude'],shapefile_record['properties']['Longitude'])) False 

This means that latitude and longitude that define a polygon in its shapefile are not in the polygon?

deleted 14 characters in body
Source Link
kuch nahi
  • 403
  • 2
  • 5
  • 9
import fiona import shapely.geometry fc = fiona.open("shapefile.shp") shapefile_record = fiona_collectionfc.next() shape = shapely.geometry.asShape(shapefile_record['geometry']) def is_constituency(lat,lng): point = shapely.geometry.Point(lat,lng) print shape.contains(point) 
import fiona import shapely.geometry fc = fiona.open("shapefile.shp") shapefile_record = fiona_collection.next() shape = shapely.geometry.asShape(shapefile_record['geometry']) def is_constituency(lat,lng): point = shapely.geometry.Point(lat,lng) print shape.contains(point) 
import fiona import shapely.geometry fc = fiona.open("shapefile.shp") shapefile_record = fc.next() shape = shapely.geometry.asShape(shapefile_record['geometry']) def is_constituency(lat,lng): point = shapely.geometry.Point(lat,lng) print shape.contains(point) 
Source Link
kuch nahi
  • 403
  • 2
  • 5
  • 9
Loading