Hello,

Maybe the following may interest you:
http://mathworld.wolfram.com/LambertConformalConicProjection.html

Regards,
Pascal


2013/8/13 Marvin Ward, Jr. <choct155@gmail.com>

> Indeed it does!  So I needed both the raster library and a fully specified
> input CRS.  This is certainly enough to get me on my way, so thank you for
> your prompt help.
>
> I do, however, still have a question.  Looking at the coordinates of my
> transformed shapefile, they are an order of magnitude different than the
> coordinates I have used in the past.  Why does clarifying the input set
> make these figures acceptable for this area?
>
> Also, if you know of a good resource that lists explanations for all
> arguments for CRS, that would be appreciated.  I have seen a lot of
> examples, and I have seen the specifications in SpatialReference.org for
> specific projections, but it would be nice to understand the mechanics a
> bit more robustly.
>
> If not, fair enough, you have helped a great deal already.
>
>
> On Tue, Aug 13, 2013 at 1:33 AM, Pascal Oettli <kridox@ymail.com> wrote:
>
>> Hi,
>>
>> The following seems to work:
>>
>> library(maptools)
>> library(gpclib)
>> library(sp)
>> library(ggmap)
>> library(rgdal)
>> library(raster)
>>
>> #Read in Ward shapefile
>> w <- readShapeSpatial('WardPly.shp')
>> projection(w) <- '+proj=lcc +lat_1=38.3 +lat_2=39.45
>> +lat_0=37.66666666666666 +lon_0=-77.0 +x_0=400000.0 +y_0=0.0 +datum=NAD83
>> +units=m +no_defs'
>>
>> #Convert to longlat projection
>> ward_ll <- spTransform(w, CRS('+proj=longlat +datum=WGS84'))
>>
>>  #Convert from SpatialPolygonsDataFrame to data.frame
>> ward <- fortify(ward_ll)
>>
>> #Create base map
>> dcmap <- qmap('washington dc',zoom=11,maptype='toner',source='stamen',
>> extent = 'normal')
>>
>> #Combine ward data with base map
>> print(dcmap + geom_polygon(aes(x=long,y=lat,group=group), data=ward,
>> colour='white',fill='red',alpha=.5,size=.2))
>>
>>
>> Regards,
>> Pascal
>>
>>
>> 2013/8/13 Marvin Ward, Jr. <choct155@gmail.com>
>>
>>>  Hello,
>>>
>>> I am afraid I am a novice in this area, so I fear I am missing a step.  I
>>> have been attempting to map the Wards in Washington DC using WardPoly.shp
>>> which I have acquired from a DC GIS website.  I have been unable to get
>>> the
>>> correct coordinates.  In fact, it appears that I am southwest of my
>>> target
>>> by some distance.  (When I google my resultant coordinates, Maps goes to
>>> the whole of North America.  If I iteratively approach them, that's when
>>> the southwest nature of my location becomes apparent.)  My thought is
>>> that
>>> I need to incorporate some of the information in the original metadata to
>>> get there, but my attempts at this point have not gone well.
>>>
>>> >From the metadata of the original file:
>>>
>>> Lambert_Conformal_Conic:
>>>
>>> Standard_Parallel: 38.300000
>>> Standard_Parallel: 39.450000
>>> Longitude_of_Central_Meridian: -77.000000
>>> Latitude_of_Projection_Origin: 37.666667
>>> False_Easting: 400000.000000
>>> False_Northing: 0.000000
>>>
>>> I have, in the past, successfully mapped on the base map I am using
>>> with CRS('+=longlat +=WGS84'), but I think I need to do
>>> something else as well.
>>>
>>>
>>> Here is my code to date:
>>> ********************************
>>> %%R
>>>
>>> library(maptools)
>>> library(gpclib)
>>> library(sp)
>>> library(ggmap)
>>>
>>> #Read in Ward shapefile
>>> w<-readShapeSpatial('/home/choct155/Google
>>>
>>> Drive/Dissertation/Data/spatial/DC/WardPly.shp',proj4string=CRS('+proj=lcc
>>> +datum=NAD83'))
>>>
>>> #Convert to longlat projection
>>> ward_ll<-spTransform(w,CRS('+proj=longlat +datum=WGS84'))
>>>
>>> #Convert from SpatialPolygonsDataFrame to data.frame
>>> ward<-fortify(ward_ll)
>>>
>>> #Create base map
>>> dcmap<-qmap('washington dc',zoom=11,maptype='toner',source='stamen')
>>>
>>> #Combine ward data with base map
>>> print(dcmap + geom_polygon(aes(x=long,y=lat,group=group),
>>>
>>> data=ward,colour='white',fill='red',alpha=.5,size=.2))
>>> *********************************
>>> This didn't work, so I tried a variations on the following theme:
>>> *********************************
>>>
>>> lon_mer<- -77.000000
>>> lat_orig<- 37.666667
>>>
>>> ward$longnew<-ward$long + lon_mer - .5*(ward$long)
>>> ward$latnew<-ward$lat + lat_orig
>>>
>>> #Create base map
>>> dcmap<-qmap('washington dc',zoom=9,maptype='toner',source='stamen')
>>>
>>> #Combine ward data with base map
>>> print(dcmap + geom_polygon(aes(x=longnew,y=latnew,group=group),
>>>
>>> data=ward,colour='white',fill='red',alpha=.5,size=.2))
>>> ********************************
>>>
>>> In general, I am not clear enough on how these elements work together,
>>> and
>>> whether or not I needed to prep the coordinates in some way.  (I should
>>> note that I did try and upstream change briefly, and discovered I
>>> couldn't
>>> modify coordinates in a spatial object. If this is the way to go, I could
>>> always go to data.frame and then back to a SpatialPolygonsDataFrame.)
>>>
>>> The biggest reason I am writing is to find out if I am barking up the
>>> wrong
>>> tree (that tree being that some account has to be made for the false
>>> eastings, origin placement, or meridian placement in the original
>>> shapefile).  For a moment, I thought about adding easting arguments to my
>>> CRS element, but then I thought 1) it would affect the output rather than
>>> take account of the input, and 2) it still did not resolve my being to
>>> far
>>> south. Any info, or a point in the direction of a useful resource would
>>> be
>>> greatly appreciated.
>>>
>>> Best Regards,
>>> Marvin Ward Jr.
>>> Fiscal Analyst
>>> Economic Affairs Unit
>>> Office of Revenue Analysis<
>>> http://cfo.dc.gov/cfo/cwp/view,a,1420,q,646852.asp>,
>>>
>>> OCFO
>>> Email:  Marvin.Ward@dc.gov
>>> Phone:  (202) 727-4054
>>>
>>>         [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo@r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>>
>
>
> --
> Marvin Ward Jr.
> Fiscal Analyst
> Economic Affairs Unit
> Office of Revenue Analysis<http://cfo.dc.gov/cfo/cwp/view,a,1420,q,646852.asp>,
> OCFO
>
> Email:  Marvin.Ward@dc.gov
> Phone:  (202) 727-4054
>

	[[alternative HTML version deleted]]

