Select to view content in your preferred language

Need to extract raster values from lat/lon point

3980
3
10-08-2013 10:14 PM
AOrlich
Emerging Contributor
Hello~

I have a shapefile with lat/lons in decimal degrees which I want to use to extract the raster cell value, which is in meters. How can I convert the decimal degrees to meters, which is the geographical location of each raster cell? If I use the Info tool to query a point from the shapefile over the raster, Arc easily pulls the shapefile point and raster cell values. I want to be able to do this in arcpy and sync this raster cell value onto my attribute table.

My shapefile is a time series of 45 days and I have daily rasters. I want to query each point to the corresponding raster to extract the appropriate cell value for the date and lat/lon of each point.

Any help is appreciated!

Thanks.
Tags (2)
0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor
Hello~

I have a shapefile with lat/lons in decimal degrees which I want to use to extract the raster cell value, which is in meters. How can I convert the decimal degrees to meters, which is the geographical location of each raster cell? If I use the Info tool to query a point from the shapefile over the raster, Arc easily pulls the shapefile point and raster cell values. I want to be able to do this in arcpy and sync this raster cell value onto my attribute table.

My shapefile is a time series of 45 days and I have daily rasters. I want to query each point to the corresponding raster to extract the appropriate cell value for the date and lat/lon of each point.

Any help is appreciated!

Thanks.


Hi A Orlich,

I assume your rasters are in a metric projection. If this is the case the easiest way of doing this is using the "Extract Multi Values to Points (Spatial Analyst)". The Help page shows Python code to do this. This tool adds the cell value at the point location for each raster. So for each raster an attribute (extra column) is created.

Before you do this, be sure to project your point data to the coordinate system the rasters are using. Use the "Project (Data Management)". Again the Help page contains a Python script sample to do this.

Kind regards,

Xander Bakker
0 Kudos
AOrlich
Emerging Contributor
Xander,

Thank you for the quick response. What you wrote made sense, but I have unsatisfactory results. The output in the column is 110 for each point in my Shapefile Feature Class (which just happens to be the value of the pixels at the North Pole (90N, all E/W)). This is confusing because both layers are visualized on the map correctly and when I use the Info tool to id the values for a point over a pixel, it returns the correct values for both.

Yes, my raster is in North Polar Sterographic projection, with meters as linear units and degree as angular units. My Point Shapefile Properties lists GCS_WGS_1984 as the Geographic Coordinate System. In ArcMap, the Data Frame properties lists the coordinate system as Polar Stereographic with a Stereographic North Pole projection, and "GCS_ WGS_1984 and Datum: D_WGS_1984" listed as well. I've dropped a copy of the Shapefile in with a Projected Coordinate System of North Polar Sterographic for kicks, and that is visualized at the North Pole.

Is the problem that I can't sync Projected and Geographic Coordinate systems?

Again, any insight and direction that you can provide is most appreciated!

Cheers,
Alice
0 Kudos
XanderBakker
Esri Esteemed Contributor
Hi Alice,

It sounds to me that the shapefile is not projected correctly. When you say:

I've dropped a copy of the Shapefile in with a Projected Coordinate  System of North Polar Stereographic for kicks, and that is visualized at  the North Pole.


... did you create that shapefile by projecting (Data Management toolbox) the shapefile? If so we should look closer to the settings you've used. An important one is the optional Geographic Transformation. For good geoprocessing results (extraction of the rasters) the data should be in the same projection.

Could you attach (part of) the original shapefile and a sample raster, so I can look into it?

Some more reading:
What are map projections? (Guide book)
Georeferencing and coordinate systems


Kind regards,

Xander
0 Kudos