[mapguide-users] Fusion and Open layers Coordinate systems

Mike Adair madair at dmsolutions.ca
Wed Oct 7 16:39:09 EDT 2009


Scott,

For anything other than EPSG:4326 or the Google spherical mercator 
projection, OpenLayers uses Proj4js http://trac.osgeo.org/proj4js/ to 
handle coordinate conversion between projections, and that uses the 
PROJ.4 format for initializing projection parameters, typically based on 
looking those up based on the EPSG code.

So if you set your BaseLayer in OpenLayers to have a projection option 
with a value of "EPSG:1234" it will internally create the required 
projection handling objects to transform coordinates.  In your 
application, you can either include a projection definition directly as in:
Proj4js.defs["EPSG:1234"]="+title=LAMB sud france  +proj=lcc +lat_1=44.1 
+lat_0=44.1 +lon_0=0 +k_0=0.999877499
                            +x_0=600000 +y_0=200000 +a=6378249.2 
+b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m";

or you can have it looks those up automatically from spatialreference.org.

Mike


Scott hameister wrote:
> I don't see anything in openlayers that lets you input a custom Projection?
> MGCoordinate looks like it has the ability to poull all the required
> Ellipsoid, units, blah blah blah out, but how do I say if ConvertWkttoEPSG
> is null Send these custom parameters into Openlayers to create a new
> projection...That confuses me.
>
>
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org
> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Jason Birch
> Sent: Wednesday, October 07, 2009 2:49 PM
> To: MapGuide Users Mail List
> Subject: Re: [mapguide-users] Fusion and Open layers Coordinate systems
>
> I don't think doing cs-map in js would be practical, but wkt parsing
> in proj4js sure would be nice...
>
> On 2009-10-07, Mike Adair <madair at dmsolutions.ca> wrote:
>   
>> It's a shame MapGuide doesn't use EPSG codes  :-)
>>
>> OpenLayers applications typically would use Proj4js to do client side
>> transformations which is based on PROJ.4 which can use EPSG codes and/or
>> custom initialization parameters.  I haven't heard of anyone converting
>> CS-Map to Javascript.
>>
>> Mike
>>
>> Scott hameister wrote:
>>     
>>> It's a shame OpenLayers doesn't use mentor/CS-Map...I thought I read
>>> somewhere that it was going to? Anyone?
>>>
>>> -----Original Message-----
>>> From: mapguide-users-bounces at lists.osgeo.org
>>> [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Jason Birch
>>> Sent: Wednesday, October 07, 2009 11:28 AM
>>> To: MapGuide Users Mail List
>>> Subject: Re: [mapguide-users] Fusion and Open layers Coordinate systems
>>>
>>> I know this is neither here nor there, but I believe there are many
>>> valid projections that do not have EPSG codes. Defaulting to LL when
>>> many "non-standard" CS are liner-units-based may not be the best
>>> approach. Would it not be possible to disable coordinate transforms if
>>> there is no code available?
>>>
>>> Jason
>>>
>>> On 2009-10-07, Mike Adair <madair at dmsolutions.ca> wrote:
>>>
>>>       
>>>> I'm currently working on a patch to retrieve the projection info from
>>>> the map definition for MapGuide.  The problem is that MG uses WKT and
>>>> OpenLayers/Fusion uses EPSG codes and MG doesn't always have an EPSG/WKT
>>>> mapping available.  So I will be implementing this so that if MG returns
>>>> a valid EPSG code it will use that, otherwise it will take a value from
>>>> the ApplicationDefinition file, and if there still isn't an EPSG code
>>>> available then the projection will be set to the OpenLayers default of
>>>> EPSG:4326.
>>>>
>>>> Mike
>>>>
>>>>
>>>>
>>>> Flipper wrote:
>>>>
>>>>         
>>>>> Im trying my hand at some Open Layers programming. I'm trying to set
>>>>>           
> the
>   
>>>>> maps
>>>>> Coordinate system to match Mapguides, So I decided to peek into
>>>>>
>>>>>           
>>> Fusion....
>>>
>>>       
>>>>> One thing for the life of me I can't find is where fusion sets the
>>>>> OpenLayer
>>>>> Maps Coordinate system. I know Open layers uses Proj 4, and Mapguide
>>>>>           
> Can
>   
>>>>> use
>>>>> both cs-map and Proj4...I know how to get the coordinate system
>>>>> Description
>>>>> out of Mapguide...But how do I push it back into OpenLayers Using my
>>>>> PROJCS
>>>>> system...
>>>>> Or worded Much simpler...How/Where does Fusion do this to
>>>>>           
> openLayers...I
>   
>>>>> want this to work on anymap...so I don't want to hard code a EPSG code
>>>>> into
>>>>> it, and several users will have Non PROJ4 coordinate systems, like
>>>>>           
> Local
>   
>>>>> County Coordinate systems that CS-MAP allows them to use...
>>>>> ANYONE?
>>>>>
>>>>>
>>>>>           
>>>> --
>>>>    Michael Adair
>>>>    Senior Software Architect
>>>>    DM Solutions Group Inc.
>>>>
>>>>    Office: (613) 565-5056 x26
>>>>    madair at dmsolutions.ca
>>>>    http://www.dmsolutions.ca
>>>>    http://research.dmsolutions.ca
>>>>
>>>>
>>>> _______________________________________________
>>>> mapguide-users mailing list
>>>> mapguide-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>>
>>>>
>>>>         
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>>
>>> _______________________________________________
>>> mapguide-users mailing list
>>> mapguide-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>>
>>>
>>>       
>> --
>>    Michael Adair
>>    Senior Software Architect
>>    DM Solutions Group Inc.
>>
>>    Office: (613) 565-5056 x26
>>    madair at dmsolutions.ca
>>    http://www.dmsolutions.ca
>>    http://research.dmsolutions.ca
>>
>>
>> _______________________________________________
>> mapguide-users mailing list
>> mapguide-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>>
>>     
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
>   

-- 
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   madair at dmsolutions.ca
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca




More information about the mapguide-users mailing list