Hello,
I am trying to match latitude and longitude coordinates from a survey with their associated UK parliamentary constituencies.
To do so, I am under the impression I need to use the packages, "shp2dta" and "geoinpoly".
I've obtained the constituency shapefile here:
https://geoportal.statistics.gov.uk/...2c2ebeab92c0_2
I then went about converting it into a .dta format using shp2dta using the follwing command:
This in turn produces a coordinates file. However, this is where the problems start to arise. The coordinates given are generic (x,y) coordinates - they are not geographic coordinates per se. If you plot them in a twoway graph they will still produce what looks like a map of the UK, however they are not in (lat, long) format
This creates a promblem when I try to match my list of survey coordinates, with the UK parliamentary data. When I run the command which I hoped would work but obviously doesn't - i.e. the following:
It reutrns the obvious error:
Is there something I'm missing? Or can anyone suggest a creative work around which might alleviate this problem?
I am trying to match latitude and longitude coordinates from a survey with their associated UK parliamentary constituencies.
To do so, I am under the impression I need to use the packages, "shp2dta" and "geoinpoly".
I've obtained the constituency shapefile here:
https://geoportal.statistics.gov.uk/...2c2ebeab92c0_2
I then went about converting it into a .dta format using shp2dta using the follwing command:
Code:
shp2dta using Westminster_Parliamentary_Constituencies__December_2017__Boundaries_UK.shp, database(A) coordinates(COORD) genid(ID)
This creates a promblem when I try to match my list of survey coordinates, with the UK parliamentary data. When I run the command which I hoped would work but obviously doesn't - i.e. the following:
Code:
geoinpoly lat long using coordinates
Y (latitude) must be between -90 and 90 in coordinates file
Comment