Hi Eting,
the problem here is that your coordinates are providing wrong information.
If I run a gdalinfo on your granule, I get this:

Corner Coordinates:
Upper Left  ( 141.2359274,  24.8528880)
Lower Left  ( 141.2359274,  24.7110480)
Upper Right ( 141.4067114,  24.8528880)
Lower Right ( 141.4067114,  24.7110480)
Center      ( 141.3213194,  24.7819680)

This represent the bbox of the granule which is also the geometry stored in
the granule catalog, as confirmed by the ogrinfo on the generated shapefile.
*POLYGON ((141.23592743897802 24.711048,141.23592743897802
24.852888,141.40671143898942 24.852888,141.40671143898942
24.711048,141.23592743897802 24.711048))*

Moreover gdalinfo provides also information about origin and resolution of
the grid to world transformation:
*Origin = (141.235927438978020,24.852888000000004)*
*Pixel Size = (0.000144000000010,-0.000144000000000)*

The ImageMosaic machinery collects and handles this information by parsing
the GeoTIFF headers and Granules bbox from the DB to apply proper
transformations when rendering to the required target.
If the coordinates in the DB are providing wrong description of the related
granule, wrong transformations will happen.
I think that what you are looking for is having support for footprints (so
you have both granules bboxes and footprints/shapes of them)
You can take a look on this section of the documentation:
http://docs.geoserver.org/2.10.x/en/user/tutorials/imagemosaic_footprint/imagemosaic_footprint.html

Does it helps?
Cheers,
Daniele



On Fri, Nov 18, 2016 at 7:25 PM, eting123 <[email protected]> wrote:

> Hi Daniele,
> Thank you so much for your help, I now understand this better.
>
> Indeed the coordinates in my database do not match yours. My coordinates:
> 141.2360354389780 24.71410800000001
> 141.2360354389780 24.84306000000000
> 141.4058114389780 24.85004400000000
> 141.4063154389780 24.72102000000001
> 141.2360354389780 24.71410800000001
>
> In comparison to yours:
> 141.23592743897802 24.711048,
> 141.23592743897802 24.852888,
> 141.40671143898942 24.852888,
> 141.40671143898942 24.711048,
> 141.23592743897802 24.711048
>
> If I put both sets of coordinates on my map, the yellow shaded one
> represents my coordinates, and the un-shaded square represents your
> coordinates.
> OldAndNewCompared.PNG
> <http://osgeo-org.1560.x6.nabble.com/file/n5296520/OldAndNewCompared.PNG>
>
> And if I now view the image mosaic layer, the image would map my old
> coordinates perfectly
> withImage.PNG
> <http://osgeo-org.1560.x6.nabble.com/file/n5296520/withImage.PNG>
>
> So in conclusion, it seems like a reprojection problem, but I am not sure
> what's the best way to resolve this yet. I would like to display my old
> coordinates on the map as the dashed footprint because they match my image,
> and I also want my image to match the dashed footprint perfectly. But it
> seems like I need 2 sets of coordinates to achieve this?
>
> I must be missing something obvious, please advise.
>
> Thank you very much,
> eting
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.
> nabble.com/Image-from-ImageMosaic-appears-smaller-than-it-should-be-
> tp5295047p5296520.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------
> ------------------
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>



-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Daniele Romagnoli
Senior Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to