Re: Dislocated Mercator Projection

From: orlando feitosa <snapsurf@hotmail.com>
Date: Mon Mar 25 2002 - 13:19:18 EST

Thanks again Don.

You are completely right, the problem is related to the SpatialIndex, I
tried to remake the index file (*.ssx), but I could noticed that, the index
file records does not changed.

Probably, the program SpatialIndex does not use the ESRYPoly.read method
when it is creating the index file (*.ssx).

I used the program SpatialIndex to list the index file records:
___________________________________________________________________
# java -mx64m com.bbn.openmap.layer.shape.SpatialIndex -d -b pc_osasc.ssx

Record 1: 50, 80; -46.770224999999996, -23.549671999999997,
-46.769557999999996, -23.549376
Record 2: 134, 200; -46.772099999999995, -23.548273, -46.770869999999995,
-23.546591
Record 3: 338, 224; -46.784279999999995, -23.492839999999998, -46.781347,
-23.491882
_____________________________________________________________________
Looking at the above coordinates LAT/LON, It seems they were not
recalculated by ERSIPoly.read method.

These are the DEBUG information at Scale=300.000
________________________________________________________________________
Praças de Osasco|ShapeLayer.ShapeWorker.construct(): fetched 0 graphics in
0.44 seconds
Praças de Osasco|ShapeLayer.ShapeWorker.construct(): getting graphics...
locateRecords:
        xmin: -46.73527145385742; ymin: -23.454090118408203
        xmax: -46.15871810913086; ymax: -23.237815856933594
Processed 106 records
Selected 0 records
Praças de Osasco|ShapeLayer.ShapeWorker.construct(): fetched 0 graphics in
0.33 seconds
ShapeLayer.paint(): 0 omg shadow=0,0
ShapeLayer.paint(): done
________________________________________________________________________

These are the DEBUG information at Scale=600.000
________________________________________________________________________
Praças de Osasco|ShapeLayer.ShapeWorker.construct(): getting graphics...
locateRecords:
        xmin: -47.02354049682617; ymin: -23.56209373474121
        xmax: -45.87044906616211; ymax: -23.129545211791992
going to shp byteOffset = 100 for record size = 168, offset = 50, shape type
= 5
going to shp byteOffset = 268 for record size = 408, offset = 134, shape
type = 5
.
.
.going to shp byteOffset = 32300 for record size = 696, offset = 16150,
shape type = 5
Processed 106 records
Selected 98 records
Praças de Osasco|ShapeLayer.ShapeWorker.construct(): fetched 98 graphics in
12.74 seconds
ShapeLayer.paint(): 98 omg shadow=0,0
ShapeLayer.paint(): done
________________________________________________________________________

What do you think Don ?
Thanks for everything.
Orlando

>From: Don Dietrick <dietrick@bbn.com>
>To: "orlando feitosa" <snapsurf@hotmail.com>
>CC: openmap-users@bbn.com
>Subject: Re: Dislocated Mercator Projection
>Date: Sun, 24 Mar 2002 18:34:29 -0500
>
>Hi Orlando,
>
>You might want to run OpenMap with a -Ddebug.shape java flag set to let the
>shape layer print out what it thinks is going on.
>
>The ShapeLayer uses a SpatialIndex file that it creates (.ssx), to let it
>know the bounding box rectangles for each graphic. The DMS coordinates of
>the shape file may be affecting what gets displayed on the screen at that
>scale. You might have to (delete and) remake the ssx file.
>
>- Don
>
>On Sunday, March 24, 2002, at 01:57 PM, orlando feitosa wrote:
>
>>Hi Don,
>>
>>Thanks for your help, I changed the original ESRIPoly.read method before
>>the degToRad call, to the following:
>>
>> radians[i+1] = ((float)readLEDouble(b, ptr));//x (lon)
>> aux = ((int) radians[i+1]);
>> radians[i+1] = ((((radians[i+1] - aux) * 60) / 100) +
>>aux);
>> // System.out.println("LON: " + radians[i+1]);
>> radians[i+1] = ProjMath.degToRad((float)radians[i+1]);
>> ptr += 8;
>>
>> radians[i] = ((float)readLEDouble(b, ptr));//y (lat)
>> aux = ((int) radians[i]);
>> radians[i] = ((((radians[i] - aux) * 60) / 100) + aux);
>> // System.out.println("LAT: " + radians[i]);
>> radians[i] = ProjMath.degToRad((float)radians[i]);
>> ptr += 8;
>>
>>and the map projection appears in right coordinates, SOLVING the problem
>>with all my Shapefiles, but another problem begun related to the SCALES.
>>When the scale is around 600,000 or greater (Zoom out) the Map is
>>displayed on the screen correctly, but when I try to Zoom in the
>>projection, the Map just disappears from the screen.
>>I tried to find other related classes or methods involved with this
>>change, but I havenít any success.
>>Do you have an idea how to solve the new problem?
>>
>>Thank you so much for attention.
>>
>>Best Regards.
>>
>>Orlando
>>
>>
>>
>>>From: Don Dietrick <dietrick@bbn.com>
>>>To: "orlando feitosa" <snapsurf@hotmail.com>
>>>CC: openmap-users@bbn.com
>>>Subject: Re: Dislocated Mercator Projection
>>>Date: Mon, 18 Mar 2002 19:25:12 -0500
>>>
>>>Hi Orlando,
>>>
>>>If that is the problem, then you can make some modifications to the shape
>>>layer package code that reads the data files, and modify them before they
>>>are used to create OMGraphics. For the com.bbn.openmap.layer.shape
>>>package, you can look in the ESRIPoly.read method, making the
>>>modifications before the degToRad() call (and so on, for each shape type
>>>you are trying to display).
>>>
>>>The com.bbn.openmap.DMSLatLonPoint could help you with the conversion,
>>>but you'd have to do the parsing to load it properly, and you'd also want
>>>to keep one in the ESRIPoly to reuse for every coordinate, instead of
>>>allocating one for every coordinate.
>>>
>>>Hope this helps,
>>>
>>>Don
>>>
>>>On Monday, March 18, 2002, at 04:21 PM, orlando feitosa wrote:
>>>
>>>>Hi Don,
>>>>
>>>>Thanks for your answer, I•m starting OpenMap with the scale=230.000
>>>>and I tried to zoom in until scale=7.187 and zoom out until
>>>>scale=920.000, but the dislocation of the map as whole keeps the same.
>>>>
>>>>Talking with Mr.Alexander, he noticed the following:
>>>>___________________________________________________________________
>>>>-23.576 --> -23 0.576*60 = -23 34.56
>>>>-46.745 --> -46 0.745*60 = -46 44.7
>>>>
>>>>The guess was that you were trying to compare Lat, Lon in decimal degree
>>>>with coordinates in Degree.Minute form. What I did is just converted
>>>>fractional part of degree to minutes.
>>>>Just double check this. Probably everything works fine and you don't
>>>>need any correction
>>>>____________________________________________________________________
>>>>
>>>>....the problem is that, I must do something!!!! I don•t know where and
>>>>how I can adjust the projection in the right coordinates (slide up the
>>>>map).
>>>>
>>>>This information should helps, for each Shapefile *.shp there is a file
>>>>called *.prj with following lines:
>>>>
>>>>&REM Clark 1866 Lat/Lon, Degrees, -180 ==> +180
>>>>&REM LL
>>>>PROJECTION GEOGRAPHIC
>>>>UNITS DD
>>>>PARAMETERS
>>>>
>>>>Thanks for any help.
>>>>
>>>>Best Regards,
>>>>
>>>>Orlando
>>>>
>>>>
>>>>
>>>>>From: Don Dietrick <dietrick@bbn.com>
>>>>>To: "orlando feitosa" <snapsurf@hotmail.com>
>>>>>CC: openmap-users@bbn.com
>>>>>Subject: Re: Dislocated Mercator Projection
>>>>>Date: Sun, 17 Mar 2002 16:06:33 -0500
>>>>>
>>>>>Hi Orlando,
>>>>>
>>>>>What scale is the map that you are looking at? Does the error decrease
>>>>>when you zoom in? You may be seeing the effects of rounding that the
>>>>>projection is doing at smaller scales, setting a pixel's coordinates to
>>>>>some value, while rounding other lat/lon values to that closest pixel
>>>>>as
>>>>>well.
>>>>>
>>>>>- Don
>>>>>
>>>>>On Saturday, March 16, 2002, at 10:50 PM, orlando feitosa wrote:
>>>>>
>>>>>>Hi Friends,
>>>>>>
>>>>>>IÃm having a problem with the Mercator Projection, when a map (a
>>>>>>Shapefile) is rendered using the ShapeLayer, all the projection
>>>>>>appears dislocated in a wrong LAT/LON coordinates.
>>>>>>
>>>>>>Here are differences in a specific coordinate:
>>>>>>
>>>>>> Wrong Projection Should be Difference in Decimal Degrees
>>>>>>LAT -23.576 -23.346 -230
>>>>>>LON -46.745 -46.445 -300
>>>>>>
>>>>>>Is there a kind of adjustment parameter to setup this dislocation?
>>>>>>
>>>>>>IÃll appreciate any help.
>>>>>>
>>>>>>Best Regards,
>>>>>>
>>>>>>Orlando
>>>>>>
>>>>>>
>>>>>>_________________________________________________________________
>>>>>>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>>>>>>
>>>>>>--
>>>>>>[To unsubscribe to this list send an email to "majdart@bbn.com"
>>>>>>with the following text in the BODY of the message "unsubscribe
>>>>>>openmap-users"]
>>>>>>
>>>>>>
>
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>Don Dietrick, dietrick@bbn.com
>BBN Technologies, Cambridge, MA
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>>>>
>>>>>--
>>>>>[To unsubscribe to this list send an email to "majdart@bbn.com"
>>>>>with the following text in the BODY of the message "unsubscribe
>>>>>openmap-users"]
>>>>
>>>>
>>>>
>>>>
>>>>_________________________________________________________________
>>>>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>>>>
>>>>--
>>>>[To unsubscribe to this list send an email to "majdart@bbn.com"
>>>>with the following text in the BODY of the message "unsubscribe
>>>>openmap-users"]
>>>>
>>>
>>
>>
>>_________________________________________________________________
>>MSN Photos is the easiest way to share and print your photos:
>>http://photos.msn.com/support/worldwide.aspx
>>
>

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Mar 25 13:24:14 2002

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT