<div>Hi Huge </div>
<div> </div>
<div>Thanx again for your reply.</div>
<div> </div>
<div><font face="Arial" size="2">How will I know which projection to use for say Albany,NY when I want to project my shapefile which is unprojected in lat/lon to some projection like Mercator or anything else ?</font></div>
<div><font color="#550055"></font> </div>
<div><font color="#550055">I am trying to convert the geographical co-ordinates to screen co-ordinates ..<br>so i require to convert the lat/lon to some projection and then convert that X,Y to pixels...<br>(hope this is correct ...!!)
</font><br> </div>
<div><font face="Arial" size="2">I am using projected co-ordiantes of Albany using the projection definition</font></div>
<div><font color="#550055"></font> </div>
<div><font color="#550055">World Mercator <54004> +proj=merc +latts=0 +lon0=0<br>+k=1.000000 +x0=0 +y0=0 +ellps=WGS84 +datum=WGS84 +units=m no_defs</font></div>
<div><font color="#550055"></font> </div>
<div><font color="#550055">but when i convert this projected X,Y in pixels </font></div>
<div><font color="#550055">there is error of 2/3 pixels in X and 8/10 pixels in Y.</font></div>
<div><font color="#550055">so this is not the right projection ....</font></div>
<div><font color="#550055"></font> </div>
<div><font color="#550055">It would be great if you could help me with this ...</font></div>
<div><font color="#550055"></font> </div>
<div><font color="#550055">Thanks</font></div>
<div><font color="#550055"></font> </div>
<div>Sandeep</div>
<div>Senior Software Engineer</div>
<div>ACL-Wireless </div>
<div>Noida, India.</div>
<p> </p>
<div><br><br> </div>
<div><span class="gmail_quote">On 10/6/06, <b class="gmail_sendername">Hugo Tyson</b> <<a href="mailto:Hugo.Tyson@cpslocates.com">Hugo.Tyson@cpslocates.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Sandeep Kumar Jakkaraju [<a href="mailto:sandeepkumar.jakkaraju@gmail.com">sandeepkumar.jakkaraju@gmail.com
</a>] wrote:<br>> So what should be the projection definition then .. to make<br>> it general..???<br>><br>> I am trying to convert the geographical co-ordinates to<br>> screen co-ordinates ..<br>> so i require to convert the lat/lon to some projection and
<br>> the convert that X,Y to pixels...<br>> hope this is correct ...<br><br>Ah. So you just want like a map of the whole world, as<br>a rectangle, sort of thing? That's not a "projection"<br>in the proj4 sense, as I understand it.
<br><br>How about<br> double x = (lon + 180.0)/360.0 * pixelswidth;<br> double y = (lat + 90.0)/180.0 * pixelsheight;<br>of course that'll be ugly at far north and south,<br>but at least it maps the whole space.
<br><br>> or is there some function in proj4/or anywhere else which<br>> does this ....??<br><br>I don't think this is the sort of thing that proj is for.<br><br>Alternatively if you're mapping a small areas of the world
<br>into one page or bitmap, you need to pick a proj4 projection<br>that works for that small area.<br><br> - Huge<br><br>PS I was mistaken in what I wrote before, mercator maps to a<br>half-cylinder wrapped around the globe. Your example touches
<br>at long 0.0, so it's still true that your long -104 is "around<br>the back".<br><br><br>> On 10/6/06, Hugo Tyson <<a href="mailto:Hugo.Tyson@cpslocates.com">Hugo.Tyson@cpslocates.com</a>> wrote:<br>
><br>> <a href="mailto:proj-bounces@lists.maptools.org">proj-bounces@lists.maptools.org</a> <> wrote:<br>> > I want to transform ... this lat/lon 39.739/-104.985...<br>> > to world mercator project ..with the defintition >
<br>> > World Mercator <54004> +proj=merc +latts=0 +lon0=0<br>> > +k=1.000000 +x0=0 +y0=0 +ellps=WGS84 +datum=WGS84 +units=m no_defs<br>> <> ><br>> > but the method gives an "error"....
<br>> ><br>> > this method works fine if i give lat/lon say 42.4182,-74.2643<br>><br>> I've not heard of "world mercator", but looking at the parameters<br>> it's projecting into a plane tangent to the sphere at
<br>> lat 0, lon 0.<br>> So it only works for longitudes from -90 to +90 (though<br>> these map<br>> to infinities in the projected plane).<br>><br>> Your example of -104 longitude is around the back of the earth,
<br>> on the "far side" from the projection plane. Therefore a<br>> line from the origin through the point never intersects the<br>> projection plane, so no result can be calculated. Hence your
<br>> error. Lon -74 is in range, so it's OK.<br><br>--<br>Hugo Tyson, Cambridge Positioning Systems Ltd<br>=************************************************************<br>********************************************************************************
<br>This email and any attachments are confidential. They have been checked for viruses but it is your<br>responsibility to conduct your own virus checks.<br>Cambridge Positioning Systems Limited, 62-64 Hills Road, Cambridge, CB2 1LA, is registered in England
<br>under company number 2808344.<br>********************************************************************************<br><br><br>_______________________________________________<br>Proj mailing list<br><a href="mailto:Proj@lists.maptools.org">
Proj@lists.maptools.org</a><br><a href="http://lists.maptools.org/mailman/listinfo/proj">http://lists.maptools.org/mailman/listinfo/proj</a><br></blockquote></div><br><br clear="all"><br>-- <br>Sandeep Kumar Jakkaraju <br>
WeBlog:<br><a href="http://jakkarajus.blogspot.com">http://jakkarajus.blogspot.com</a>