2

I started with an AutoCAD DWG file and used FME Workbench to extract elevation data into a shapefile.

read_sf yields:

> shapename
Simple feature collection with 41620 features and 1 field (with 757 geometries empty)
geometry type:  MULTIPOLYGON
dimension:      XYZ
bbox:           xmin: 313368.6 ymin: 4832795 xmax: 314211.3 ymax: 4833629
epsg (SRID):    4267
proj4string:    +proj=longlat +ellps=clrk66 +no_defs
# A tibble: 41,620 x 2
   Massing_ID                                                                                geometry
        <int>                                                                      <MULTIPOLYGON [°]>
 1         NA Z (((313962.3 4832886 6.7, 314004.9 4832898 6.7, 314000.5 4832913 6.7, 313962.3 4832...
 2         NA Z (((313974.8 4832889 11.58, 313973.6 4832894 11.58, 313966.3 4832892 11.58, 313974....
 3         NA Z (((313975.1 4832904 11.58, 313976.1 4832901 11.58, 313964.6 4832898 11.58, 313975....

Trying shp_crs <- st_transform(shapename, crs=4326) yields:

> shp_crs
Simple feature collection with 41620 features and 1 field (with 757 geometries empty)
geometry type:  MULTIPOLYGON
dimension:      XYZ
bbox:           xmin: 313368.6 ymin: 4832795 xmax: 314211.3 ymax: 4833629
epsg (SRID):    4326
proj4string:    +proj=longlat +datum=WGS84 +no_defs
# A tibble: 41,620 x 2
   Massing_ID                                                                                geometry
        <int>                                                                      <MULTIPOLYGON [°]>
 1         NA Z (((313962.3 4832886 6.7, 314004.9 4832898 6.7, 314000.5 4832913 6.7, 313962.3 4832...
 2         NA Z (((313974.8 4832889 11.58, 313973.6 4832894 11.58, 313966.3 4832892 11.58, 313974....
 3         NA Z (((313975.1 4832904 11.58, 313976.1 4832901 11.58, 313964.6 4832898 11.58, 313975....

The data is unchanged. Only proj4string has changed. Why is this?

3

If these values:

bbox:           xmin: 313368.6 ymin: 4832795 xmax: 314211.3 ymax: 4833629

(which are the range of the data location values) are latitude-longitude:

proj4string:    +proj=longlat +ellps=clrk66 +no_defs

then something is terribly wrong with the shape of the earth.

Lat-long coordinates should only ever be (-180,180),(-90,90) - your coordinates are clearly not in that range and so the transformation code just shrugs and returns the same numbers. Its a "Garbage-in, Garbage-out" philosophy. Possibly an error message would be better, but the mistake was made previous to this.

Your data is more likely in a projected coordinate system, and might be in metres, like a UTM zone. Less likely its degrees multiplied by 10,000 for some reason.

  • Got it. Thanks. – ixodid Apr 18 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.