Sorry, my mistake: I misunderstood what you were trying to do.<br>As Mike says: the compressed script should have the specific definitions for the different projection types.<br>As an aside, I've just implemented the "gnom" projection which I shall be checking in soon (probably later tonight).<br>
<br>Richard<br><br><div class="gmail_quote">On Thu, Nov 19, 2009 at 1:28 PM, Dash <span dir="ltr"><<a href="mailto:jimlug@co.clackamas.or.us">jimlug@co.clackamas.or.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks for the quick response Richard, but I don't see how I'm re-projecting<br>
raster layers when I'm explicitly specifying coordinates to transform? I'm<br>
only using the transformation on coordinates, not the base layers (Google).<br>
<br>
Ahhh, I just figured it out. Here is what I had to do in-order to transform<br>
coordinates from EPSG:2913 (Stateplane) to EPSG:900913. Within the head tag<br>
I added 2 projCodes (lcc.js and merc.js).<br>
<div class="im"><br>
<script src="./proj4js/lib/proj4js.js"></script><br>
</div><script src="./proj4js/lib/proj4js-compressed.js"></script><br>
<div class="im"><script src="./proj4js/lib/defs/EPSG2913.js"></script><br>
</div><script src="./proj4js/lib/projCode/lcc.js"></script><br>
<script src="./proj4js/lib/projCode/merc.js"></script><br>
<br>
Also, here is my transformation:<br>
<br>
var srcProj = new OpenLayers.Projection("EPSG:2913");<br>
var destProj = new OpenLayers.Projection("EPSG:900913");<br>
var point = new OpenLayers.LonLat(7662464.286, 614886.646);<br>
<div class="im">point.transform(srcProj, map.getProjectionObject());<br>
<br>
</div>My input coordinates were: 7662464.286, 614886.646<br>
Transformed coordinates: -13647631.260266263, 5674262.881180859<br>
<br>
Works great, at least for now.<br>
<div><div></div><div class="h5"><br>
<br>
Richard Marsden wrote:<br>
><br>
> It looks like you are trying to re-project Google raster layers?<br>
><br>
> I thought OpenLayers was only capable of re-projecting vector layers?<br>
><br>
> For example, the following article uses OpenLayers (& Proj4JS) to<br>
> re-project<br>
> KML and GeoRSS data (geographic coords, WGS84) to a number of different<br>
> projections (Mollweide, Behrmann, etc):<br>
><br>
> <a href="http://www.geowebguru.com/articles/209-how-to-create-an-online-map-with-a-non-mercator-projection-part-2" target="_blank">http://www.geowebguru.com/articles/209-how-to-create-an-online-map-with-a-non-mercator-projection-part-2</a><br>
><br>
><br>
> Richard Marsden<br>
> Winwaed Software Technology LLC<br>
> <a href="http://www.winwaed.com" target="_blank">http://www.winwaed.com</a><br>
> <a href="http://www.mapping-tools.com" target="_blank">http://www.mapping-tools.com</a><br>
> <a href="http://www.geowebguruc.om" target="_blank">http://www.geowebguruc.om</a><br>
><br>
><br>
> On Thu, Nov 19, 2009 at 12:12 PM, Dash <<a href="mailto:jimlug@co.clackamas.or.us">jimlug@co.clackamas.or.us</a>> wrote:<br>
><br>
>><br>
>> Aloha Thursday folks,<br>
>><br>
>> I am banging my head against the problem for the last several hours. I<br>
>> have<br>
>> went through numerous examples and utilized OpenLayers tutorial on<br>
>> reprojecting points without any success. I've even used the Proj4js Wiki<br>
>> without any help. Could some please shed some light on what I am doing<br>
>> wrong?<br>
>><br>
>> Here is the scenario. I am trying to transform some coordinates from<br>
>> EPSG:2913 to EPSG:900913. I've also tried a simplified version using<br>
>> EPSG:4326 -> EPSG:900913. Anyway, the transform is not happening for<br>
>> some<br>
>> odd reason. I do have the proj4js library within my code and I have<br>
>> added<br>
>> EPSG definition to my /proj4js/lib/def directory. I am checking if the<br>
>> projection by using the getUnits function of the projection class within<br>
>> OpenLayers. If the units come back null, then the proj4js library is<br>
>> unavailable. Why is this? I'm so confused. This should be rather<br>
>> straight<br>
>> forward. Anyway, here is some of my code. Hopefully someone can help me<br>
>> out. Thanks.<br>
>><br>
>> <head><br>
>> <script src="<a href="http://openlayers.org/dev/lib/OpenLayers.js" target="_blank">http://openlayers.org/dev/lib/OpenLayers.js</a>"<br>
>> type="text/javascript"></script><br>
>> <script src="./proj4js/lib/proj4js.js"></script><br>
>> <script src="proj4js/lib/defs/EPSG2913.js"></script><br>
>> <script src="proj4js/lib/defs/EPSG900913.js"></script><br>
>> <script src="proj4js/lib/defs/EPSG4326.js"></script><br>
>> </head><br>
>><br>
>> <script type="text/javascript"><br>
>> var map;<br>
>> function init(){<br>
>> var options = {<br>
>> //projection: new OpenLayers.Projection("EPSG:900913"),<br>
>> // Map projection<br>
>> projection: "EPSG:900913",<br>
>> displayProjection: new OpenLayers.Projection("EPSG:4326"),<br>
>> // Display<br>
>> projection<br>
>> units: "m",<br>
>> numZoomLevels: 5,<br>
>> maxResolution: 156543.0339,<br>
>> maxExtent: new OpenLayers.Bounds(-13698618.8209569,<br>
>> 5595988.4768255,<br>
>> -13521569.8682338, 5701506.49106001)<br>
>> };<br>
>><br>
>> // Initiate Map Controls<br>
>> map.addControl(new OpenLayers.Control.LayerSwitcher());<br>
>> map.addControl(new OpenLayers.Control.MousePosition());<br>
>><br>
>> // Create Google Mercator Layers<br>
>> var gmap = new OpenLayers.Layer.Google("Google<br>
>> Streets",{'sphericalMercator': true, numZoomLevels: 20});<br>
>> var gphy = new OpenLayers.Layer.Google("Google Physical",<br>
>> {'sphericalMercator': true, type: G_PHYSICAL_MAP, numZoomLevels: 20});<br>
>> var gsat = new OpenLayers.Layer.Google("Google<br>
>> Satellite",{'sphericalMercator': true, type: G_SATELLITE_MAP,<br>
>> numZoomLevels:<br>
>> 20});<br>
>> var ghyb = new OpenLayers.Layer.Google("Google<br>
>> Hybrid",{'sphericalMercator': true, type: G_HYBRID_MAP, numZoomLevels:<br>
>> 20});<br>
>><br>
>> map.addLayers([gmap, gphy, gsat, ghyb]);<br>
>><br>
>> var srcProj = new OpenLayers.Projection("EPSG:4326");<br>
>> alert(srcProj.getUnits());<br>
>> var point = new OpenLayers.LonLat(-71, 42);<br>
>> point.transform(srcProj, map.getProjectionObject());<br>
>><br>
>> if(point.transformed)<br>
>> {<br>
>> alert("point already transformed");<br>
>> }<br>
>><br>
>> Proj4js.transform(srcProj, map.getProjectionObject(), point);<br>
>><br>
>> Any suggestions would be greatly appreciated. THANKS...<br>
>> --<br>
>> View this message in context:<br>
>> <a href="http://n2.nabble.com/transform-help-please-tp4033462p4033462.html" target="_blank">http://n2.nabble.com/transform-help-please-tp4033462p4033462.html</a><br>
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
>> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
>><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
><br>
><br>
<br>
</div></div><font color="#888888">--<br>
View this message in context: <a href="http://n2.nabble.com/transform-help-please-tp4033462p4033873.html" target="_blank">http://n2.nabble.com/transform-help-please-tp4033462p4033873.html</a><br>
</font><div><div></div><div class="h5">Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>