Hi Mohammed,

There seem to be a few problems with your openlayers code. If you
agree to contribute it to Wt, please send us the source and we will
take a look at it to see if we can fix it. It would be a good thing to
have an openlayers widget in Wt.

For the second question, read the documentation of WPainter, which
explains the WPainter coordinate system:
http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WPainter.html

The origin is on the top left, X runs horizontally to the right, while
Y runs vertically and down. Verify that this is the same as the GIS
coordinate system; if not, you'll may have to (1) apply a scale of -1
for X and/or Y to flip the coordinate system (e.g. to make Y run up)
and (2) apply a transformation, when your GIS (0,0) point is e.g.
bottom left.

xMin and yMin is to become the new origin, so you'll need to translate
over that distance (actually, this may change if you had to flip axis
the axis system for the reason mentioned above).

And then you'll need to scale and translate the GIS coordinates so
that they map on your painter window. Let 'width' be your painters
width, 'height' be your painter's height. In the example you gave
(xMin,yMin -63.5551,-20.6821 : xMax,yMax -40.053,-3.03993), the GIS
width ('gwidth') is 63-40 = 23; the height ('gheight') is 20-3 = 17.
This has to map on the painter's coordinates, so you'll need to scale
a gis coordinate X component as follows: X/gwidth*width; similar for
Y.

You can either do these calculations manually on your coordinates, or
you can put them all together in a WTranform that you push on the
painter, in which case you'll be able to simply draw your GIS
coordinates. The transformation will be applied to each coordinate to
make them fit in the painter window.

There's a lot of information to find about this on the net; e.g. read
the links below:
http://www.willamette.edu/~gorr/classes/GeneralGraphics/Transforms/transforms2d.htm
http://en.wikipedia.org/wiki/Transformation_matrix
http://processing.org/learning/transform2d/
(... use google)

hope this helps,
Wim.

2011/1/11 Mohammed Rashad <[email protected]>:
> Hi,
> As you know I am using Wt for my project (Collaborative Mapping
> Platform).its has good features when we ignore Wt Internal Error.
> I had also created an openlayers widget and will contribute if you are
> interested. the widget creation is not finished yet.
> A peek is at lsi.iiit.ac.in/wt/vgis.wt. It has more features than WGoogleMap
> it includes google map also. All I have done is with the help of you and the
> community.
> Now I want to read shapefile directly and display point,line or polygon
> using WPaintedWidget. for that I need the following thing
> I need to set the bounding box of the painted widget so that i can load
> points directly
> I have a ESRI shapefile called test.shp which contains seven points
> I can open it and read the points one by one using OGR.
> the spatial reference system (boundingbox) : xMin,yMin -63.5551,-20.6821 :
> xMax,yMax -40.053,-3.03993
> These terms may be new to you and community because these are realed to GIS.
> All I need to know from you is how to set the coordinate system of wt's
> WPaintedWidget to the above given xMin,yMin -63.5551,-20.6821 : xMax,yMax
> -40.053,-3.03993
> Which can help me in this part?.
> what should I learn?.
> Does WTransform or setting world transform can do the job? If yes how?
> Expecting a good helping hand from you or community
> --
> Rashad
>

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to