[MetaCRS] proj4js design questions
Norm Olsen
norm.olsen at autodesk.com
Wed Mar 5 13:13:59 EST 2008
Hello Mike . . .
I've been writing this type of code for years. I agree with you, passing in separate references for x, y, & z and completing the conversion in place is the best approach.
I can't comment about Java, but in C++, when using objects of some sort for a point, the compiler ends up doing all kinds of stuff to convert types around that is undesirable in a high performance environment. At the lower levels, present an interface that provides the highest performance in the most generic manner. That, to me, means passing three separate references as you suggest.
Norm Olsen
-----Original Message-----
From: metacrs-bounces at lists.osgeo.org [mailto:metacrs-bounces at lists.osgeo.org] On Behalf Of Mike Adair
Sent: Wednesday, March 05, 2008 8:33 AM
To: Richard Greenwood
Cc: mapbuilder-proj at lists.sourceforge.net; metacrs at lists.osgeo.org
Subject: [MetaCRS] proj4js design questions
Looks like we've been Warnocked [1] on Richard's previous email [2], but
there are important design questions posed in that email that need
discussion so I will pose the questions separately and hopefully get
some discussion on these points:
- in the transform method, should the point be passed in by reference
and coordinates transformed in place, or should transform just use the
x,y,z values passed in and return a new point object to the caller?
My preference is to transform the coordinates in place, mostly because
that is a lot more convenient and efficient in JavaScript than having to
copy object properties before and after a transformation. Also, any
kind of 'point' object can be passed in and as long as it has x,y(z)
properties, the transform will modify those properties leaving the rest
of the object intact.
Comments?
Mike
[1] http://en.wikipedia.org/wiki/Warnocked
[2]
http://sourceforge.net/mailarchive/forum.php?thread_name=ae9185aa0802110929t7dd45f74q78855b9f3b53e065%40mail.gmail.com&forum_name=mapbuilder-proj
_______________________________________________
MetaCRS mailing list
MetaCRS at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/metacrs
More information about the MetaCRS
mailing list