Re: [gdal-dev] Convert S57 to image with S52 rendering
Storkur, For further question on S52 I think it would be best if we e-mail directly instead of gdal-dev. All answer directly to you in my next mail. rgds, Sylvain. On Tue, 9/2/14, Storkur sovof...@yandex.ru wrote: Subject: Re: [gdal-dev] Convert S57 to image with S52 rendering To: gdal-dev@lists.osgeo.org Received: Tuesday, September 2, 2014, 4:12 AM Sylvain, I couldn't build changing this line of code. But i have succeed using another version of Linux. I have built s52 on Ubuntu 14.04 and on our target platform Astra Linux (based on debian) On Ubuntu i running test/s52glx it displays some data from my file. But in Astra it says /S57data.c:337 in S57_geo2prj3dv(): ERROR: nothing to project to .. load a chart frist! ** ERROR:S57data.c:339:S57_geo2prj3dv: assertion failed: (0) S52.c:1332 in _trapSIG(): Signal SIGABRT(6) cought .. Abort/ -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Convert-S57-to-image-with-S52-rendering-tp4987897p5159559.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Convert S57 to image with S52 rendering
Storkur, Yes, use the call : S52_dumpS57IDPixels(const char *toFilename, unsigned int S57ID, unsigned int width, unsigned int height); Check https://github.com/sduclos/S52/blob/master/S52.h for details rgds, Sylvain. On Fri, 8/29/14, Storkur sovof...@yandex.ru wrote: Subject: Re: [gdal-dev] Convert S57 to image with S52 rendering To: gdal-dev@lists.osgeo.org Received: Friday, August 29, 2014, 2:10 AM Sylvain Duclos, Thanks. And is there is simple way to automaticaly convert s-57 maps to tiled raster images with specified scale? May be not following s-52 specs. -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Convert-S57-to-image-with-S52-rendering-tp4987897p5158977.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] Convert S57 to image with S52 rendering
Storkur, I just found your mail in the spam box. The code is now at : https://github.com/sduclos/S52 It is base on very old S52 Specs https://github.com/sduclos/S52/blob/master/doc/pslb03_2.pdf Newer specs are not free. I don't know about tiling but I think MapServer can do that. Rgds, Sylvain Duclos. On Tue, 8/26/14, Storkur sovof...@yandex.ru wrote: Subject: Re: [gdal-dev] Convert S57 to image with S52 rendering To: gdal-dev@lists.osgeo.org Received: Tuesday, August 26, 2014, 4:04 AM We are also interested in such combination of libs. Best regards -- View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Convert-S57-to-image-with-S52-rendering-tp4987897p5158302.html Sent from the GDAL - Dev mailing list archive at Nabble.com. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] regarding s57 colour codes
Girish, You might find some answer here: http://grasswiki.osgeo.org/wiki/S-57_data rgds, Sylvain. On Tuesday, March 11, 2014 4:22:39 PM, Girish Deshpande deshpande...@gmail.com wrote: Hello, I am able to render s57 chart in my application using gdal, i am finding difficulty in filling the areas with specific colors. please help me in this regards. -- Thanks Regards, Girish Deshpande ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] FIDN-issue
Nikhil, I loaded your S57. Here's a typical output for FIDN in US51.000 S52.c:2719 in S52_loadLayer(): LOADING LAYER NAME: LIGHTS S57ogr.c:81 in _setAtt(): FIDN:44884 S57ogr.c:81 in _setAtt(): FIDN:44877 S57ogr.c:81 in _setAtt(): FIDN:44885 S57ogr.c:81 in _setAtt(): FIDN:1521038204 // -- 44886 ! S57ogr.c:81 in _setAtt(): FIDN:-1257713504 // -- 44887 ! S57ogr.c:81 in _setAtt(): FIDN:-72495485 // -- 44888 ! S57ogr.c:81 in _setAtt(): FIDN:-2048579800 // -- 44889 ! S57ogr.c:81 in _setAtt(): FIDN:44880 S57ogr.c:81 in _setAtt(): FIDN:44872 S57ogr.c:81 in _setAtt(): FIDN:44881 S57ogr.c:81 in _setAtt(): FIDN:44873 S57ogr.c:81 in _setAtt(): FIDN:44882 S57ogr.c:81 in _setAtt(): FIDN:44874 S57ogr.c:81 in _setAtt(): FIDN:44883 S57ogr.c:81 in _setAtt(): FIDN:44875 S57ogr.c:81 in _setAtt(): FIDN:44876 S57ogr.c:81 in _setAtt(): FIDN:44879 S57ogr.c:81 in _setAtt(): FIDN:44878 S57ogr.c:81 in _setAtt(): FIDN:44886 S57ogr.c:81 in _setAtt(): FIDN:44887 S57ogr.c:81 in _setAtt(): FIDN:2054113595 // -- 44888 ! This chart is in the Indian Ocean in the middle of nowhere ! Sound like a chart you've made yourself. That lead me to think that the culprit might be the soft that made this S57. Most of your FIDN seem consistent but, for example, the 4th line: 1521038204 should be 44886 Sound like a rollover or something like that .. rgds, Sylvain. From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Cc: 'Frank Warmerdam' warmer...@pobox.com; 's duclos' sylvain_duc...@yahoo.com Sent: Tuesday, December 11, 2012 2:19:26 AM Subject: FIDN-issue Hi , In my application I am fetching S57 data set where it is fetching FIDN with negative value which is wrong because FIDN should be in Range: 1 to 2 power 32-1 Is there any instance that any one got the same issue. If the same data source is loaded in Caris Easy view it is showing some other legal value. Please load the sample data with any application in open source it will show the same as mentioned above Thanks and Regards Nikhil Sai Parupalli ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] S57 dataset boundary issue
Nikhil, If I have a polygon how to find out edges of it programmatic do we have any function to get all the edges of polygon(area) OGR is modelled on the OpenGIS simple features data model, http://www.gdal.org/ogr/ogr_arch.html In this model there is no notion of edge like in S-57 You did use the OGR internal representation using RETURN_LINKAGES=ON But that is for debugging .. it's not part of OGR official interface as I can see. But RETURN_LINKAGES=ON give you a fighting chance if you need to find edge and also to will need to hack the source code of OGR as it limit the output to 80 char. rgds, Sylvain. From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Thursday, October 11, 2012 1:26:47 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Hey Sylvain, Thanks for your inputs, we have successfully implemented the same in our project . I have one more question i.e If I have a polygon how to find out edges of it programmatic do we have any function to get all the edges of polygon(area) Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: Nikhil Sai Parupalli Sent: Wednesday, October 10, 2012 9:07 PM To: s duclos Subject: RE: [gdal-dev] S57 dataset boundary issue Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 8:43 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Hi Nikhil, Based on the code which you have sent we could find out CW and CCW, but not outer/inner The outer ring of OGRGeometryH poly is the ring 0 (zero). In C code the OGR call: guint nRingCount = OGR_G_GetGeometryCount(hGeom); will give you the number of rings in a poly. Say there is 2 rings for this hGeom. Then the outer ring is OGRGeometryH *hGeomRef_outter = OGR_G_GetGeometryRef(hGeom, 0); and the inner ring is OGRGeometryH *hGeomRef_inner = OGR_G_GetGeometryRef(hGeom, 1); Please have a look at that data set once and let me know. There is nothing in attachment rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 10:40:27 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Hey Sylvain, Thanks for trying the data which I have sent. Could you be helping me how this works like outer boundary and inner boundary. Based on the code which you have sent we could find out CW and CCW, but not outer/inner Please have a look at that data set once and let me know. Or if you have any sample data with simple representation of outer and inner boundaries please do share with me. Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 7:59 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Hi Nikhil, I loaded US1GC09M//US1GC09M.000 .. it's huge :) It's the Gulf of Mexico .. now where should I look ? About the inner / outer ring. As I said before, I just assume that OGR send me the outer ring first. And, up to now, my code is working fine. rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 9:40:54 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Could you try on this data set please Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 7:02 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Nikhil, I loaded your ENC. I see a number of depth area (DEPARE) and anchor zone area (ACHARE). But no inner ring! Is there an inner rings somewhere I should see? rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli
Re: [gdal-dev] S57 update (was: (no subject))
Hi Nikhil, In the US1GC09M.ZIP you send you can see update as US1GC09M.000 -- base cell US1GC09M.001 - .008 -- update to base cell rgds, Sylvain. From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Thursday, October 11, 2012 2:28:40 AM Subject: [gdal-dev] (no subject) Hi All, How do we get to know which S57 dataset has update sin it.. Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] S57 update (was: (no subject))
Hi Nikhil, Frank as put up a page for this (sorry Frank for highjacking the thread) http://www.gdal.org/ogr/drv_s57.html Also IHO have the specs for updating ENC specifically. (I don't have the link right now) rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Thursday, October 11, 2012 2:26:54 PM Subject: RE: [gdal-dev] S57 update (was: (no subject)) Hey HOw do we get to know in data set i.e any attribute information varies for update... Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Thursday, October 11, 2012 8:55 PM To: Nikhil Sai Parupalli; gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 update (was: (no subject)) Hi Nikhil, In the US1GC09M.ZIP you send you can see update as US1GC09M.000 -- base cell US1GC09M.001 - .008 -- update to base cell rgds, Sylvain. From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Thursday, October 11, 2012 2:28:40 AM Subject: [gdal-dev] (no subject) Hi All, How do we get to know which S57 dataset has update sin it.. Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] S57 dataset boundary issue
Nikhil, I loaded your ENC. I see a number of depth area (DEPARE) and anchor zone area (ACHARE). But no inner ring! Is there an inner rings somewhere I should see? rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 8:00:41 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Duclos, Please see this sample data attached. So as per the code given by you we have tried and got result i.e able to find out area some times it shows area0 and some times area0 hence we get CW and CCW. But how do we classify in layer which is outer boundary and which is inner boundary Geometry testgeo = geomLAKARE.GetBoundary(); double area = 0; for (int l = 0; l testgeo.GetPointCount() - 1; l++) { double x1 = testgeo.GetX(l); double y1 = testgeo.GetY(l); double x2 = testgeo.GetX(l + 1); double y2 = testgeo.GetY(l + 1); area += (x1 * y2) - (x2 * y1); } Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Tuesday, October 09, 2012 11:58 PM To: Frank Warmerdam; Nikhil Sai Parupalli Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Frank Nikhil, Frank asked: are, I'm not sure what I or others can do about the performance cost of checking. If I understand the problem, then it cost nothing! You have to check the winding while loading a OGRGeometryH like so: double area = 0; for (unsigned int i=0; ivert_count-1; i++) { double x1 = OGR_G_GetX(hRing, i); double y1 = OGR_G_GetY(hRing, i); double x2 = OGR_G_GetX(hRing, i+1); double y2 = OGR_G_GetY(hRing, i+1); area += (x1*y2) - (x2*y1); } If the area 0 then it is CW (clockwise) and 0 is CCW (Counter CW). Note that in S57 the exterior ring must be CW and interior ring are CCW. But in S57 there is no order between rings. So interior ring might come first. I think WKT fix this. In my code I assume that OGR place the exterior ring first. We have been trough this before. At the time the question was if S57 allow for many exterior ring for the same poly. I guess it all depend on HO and how they encode the data. I'm using mostly Canadian ENC and found no problem. But other HO might encode ENC differently .. rdgs, Sylvain Duclos. From: Frank Warmerdam warmer...@pobox.com To: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Tuesday, October 9, 2012 12:25:29 PM Subject: Re: [gdal-dev] S57 dataset boundary issue On Mon, Oct 8, 2012 at 10:28 PM, Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com wrote: HI All, , Thanks for the reply in below data NAME_RCNM (IntegerList) = (7:130,130,130,130,130,130,130) NAME_RCID (IntegerList) = (7:691,391,690,52,1336,1503,1512) ORNT (IntegerList) = (7:2,2,2,2,1,1,1) USAG (IntegerList) = (7:1,1,1,1,1,1,1) MASK (IntegerList) = (7:255,255,255,255,255,255,255) RCID 691 ORNT has 2 and USAG is 1 based on this data we could identify that RCID 691 is of exterior boundary with reverse direction. So if I have 1000 RCID in NAME_RCID which is vise versa for the above condition I need to display that RCIDS list as errors. So it makes 1000 conditional checks hence reducing performance. Please let us know further. Nikhil, I'm afraid I don't follow your point. Are you trying to do some sort of ring orientation validation and identify ones that don't match your expectations? And you are concerned about the performance cost? I don't know why you are doing this, and if you are, I'm not sure what I or others can do about the performance cost of checking. Best regards,-- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Software Developer ___ gdal-dev
Re: [gdal-dev] S57 dataset boundary issue
Hi Nikhil, I loaded US1GC09M//US1GC09M.000 .. it's huge :) It's the Gulf of Mexico .. now where should I look ? About the inner / outer ring. As I said before, I just assume that OGR send me the outer ring first. And, up to now, my code is working fine. rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 9:40:54 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Could you try on this data set please Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 7:02 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Nikhil, I loaded your ENC. I see a number of depth area (DEPARE) and anchor zone area (ACHARE). But no inner ring! Is there an inner rings somewhere I should see? rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 8:00:41 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Duclos, Please see this sample data attached. So as per the code given by you we have tried and got result i.e able to find out area some times it shows area0 and some times area0 hence we get CW and CCW. But how do we classify in layer which is outer boundary and which is inner boundary Geometry testgeo = geomLAKARE.GetBoundary(); double area = 0; for (int l = 0; l testgeo.GetPointCount() - 1; l++) { double x1 = testgeo.GetX(l); double y1 = testgeo.GetY(l); double x2 = testgeo.GetX(l + 1); double y2 = testgeo.GetY(l + 1); area += (x1 * y2) - (x2 * y1); } Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Tuesday, October 09, 2012 11:58 PM To: Frank Warmerdam; Nikhil Sai Parupalli Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Frank Nikhil, Frank asked: are, I'm not sure what I or others can do about the performance cost of checking. If I understand the problem, then it cost nothing! You have to check the winding while loading a OGRGeometryH like so: double area = 0; for (unsigned int i=0; ivert_count-1; i++) { double x1 = OGR_G_GetX(hRing, i); double y1 = OGR_G_GetY(hRing, i); double x2 = OGR_G_GetX(hRing, i+1); double y2 = OGR_G_GetY(hRing, i+1); area += (x1*y2) - (x2*y1); } If the area 0 then it is CW (clockwise) and 0 is CCW (Counter CW). Note that in S57 the exterior ring must be CW and interior ring are CCW. But in S57 there is no order between rings. So interior ring might come first. I think WKT fix this. In my code I assume that OGR place the exterior ring first. We have been trough this before. At the time the question was if S57 allow for many exterior ring for the same poly. I guess it all depend on HO and how they encode the data. I'm using mostly Canadian ENC and found no problem. But other HO might encode ENC differently .. rdgs, Sylvain Duclos. From: Frank Warmerdam warmer...@pobox.com To: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Tuesday, October 9, 2012 12:25:29 PM Subject: Re: [gdal-dev] S57 dataset boundary issue On Mon, Oct 8, 2012 at 10:28 PM, Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com wrote: HI All, , Thanks for the reply in below data NAME_RCNM (IntegerList) = (7:130,130,130,130,130,130,130) NAME_RCID (IntegerList) = (7:691,391,690,52,1336,1503,1512) ORNT (IntegerList) = (7:2,2,2,2,1,1,1) USAG (IntegerList) = (7:1,1,1,1,1,1,1) MASK (IntegerList
Re: [gdal-dev] S57 dataset boundary issue
Hi Nikhil, Based on the code which you have sent we could find out CW and CCW, but not outer/inner The outer ring of OGRGeometryH poly is the ring 0 (zero). In C code the OGR call: guint nRingCount = OGR_G_GetGeometryCount(hGeom); will give you the number of rings in a poly. Say there is 2 rings for this hGeom. Then the outer ring is OGRGeometryH *hGeomRef_outter = OGR_G_GetGeometryRef(hGeom, 0); and the inner ring is OGRGeometryH *hGeomRef_inner = OGR_G_GetGeometryRef(hGeom, 1); Please have a look at that data set once and let me know. There is nothing in attachment rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 10:40:27 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Hey Sylvain, Thanks for trying the data which I have sent. Could you be helping me how this works like outer boundary and inner boundary. Based on the code which you have sent we could find out CW and CCW, but not outer/inner Please have a look at that data set once and let me know. Or if you have any sample data with simple representation of outer and inner boundaries please do share with me. Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 7:59 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Hi Nikhil, I loaded US1GC09M//US1GC09M.000 .. it's huge :) It's the Gulf of Mexico .. now where should I look ? About the inner / outer ring. As I said before, I just assume that OGR send me the outer ring first. And, up to now, my code is working fine. rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 9:40:54 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Could you try on this data set please Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Wednesday, October 10, 2012 7:02 PM To: Nikhil Sai Parupalli; Frank Warmerdam Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Nikhil, I loaded your ENC. I see a number of depth area (DEPARE) and anchor zone area (ACHARE). But no inner ring! Is there an inner rings somewhere I should see? rgds, Sylvain. - Original Message - From: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com To: s duclos sylvain_duc...@yahoo.com; Frank Warmerdam warmer...@pobox.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Wednesday, October 10, 2012 8:00:41 AM Subject: RE: [gdal-dev] S57 dataset boundary issue Duclos, Please see this sample data attached. So as per the code given by you we have tried and got result i.e able to find out area some times it shows area0 and some times area0 hence we get CW and CCW. But how do we classify in layer which is outer boundary and which is inner boundary Geometry testgeo = geomLAKARE.GetBoundary(); double area = 0; for (int l = 0; l testgeo.GetPointCount() - 1; l++) { double x1 = testgeo.GetX(l); double y1 = testgeo.GetY(l); double x2 = testgeo.GetX(l + 1); double y2 = testgeo.GetY(l + 1); area += (x1 * y2) - (x2 * y1); } Thanks and Regards Nikhil Sai Parupalli Note: Do not print this email until and unless it is really required. Save paper , stay Green From: s duclos [sylvain_duc...@yahoo.com] Sent: Tuesday, October 09, 2012 11:58 PM To: Frank Warmerdam; Nikhil Sai Parupalli Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] S57 dataset boundary issue Frank Nikhil, Frank asked: are, I'm not sure what I or others can do about the performance cost of checking
Re: [gdal-dev] S57 dataset boundary issue
Frank Nikhil, Frank asked: are, I'm not sure what I or others can do about the performance cost of checking. If I understand the problem, then it cost nothing! You have to check the winding while loading a OGRGeometryH like so: double area = 0; for (unsigned int i=0; ivert_count-1; i++) { double x1 = OGR_G_GetX(hRing, i); double y1 = OGR_G_GetY(hRing, i); double x2 = OGR_G_GetX(hRing, i+1); double y2 = OGR_G_GetY(hRing, i+1); area += (x1*y2) - (x2*y1); } If the area 0 then it is CW (clockwise) and 0 is CCW (Counter CW). Note that in S57 the exterior ring must be CW and interior ring are CCW. But in S57 there is no order between rings. So interior ring might come first. I think WKT fix this. In my code I assume that OGR place the exterior ring first. We have been trough this before. At the time the question was if S57 allow for many exterior ring for the same poly. I guess it all depend on HO and how they encode the data. I'm using mostly Canadian ENC and found no problem. But other HO might encode ENC differently .. rdgs, Sylvain Duclos. From: Frank Warmerdam warmer...@pobox.com To: Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com Cc: gdal-dev@lists.osgeo.org gdal-dev@lists.osgeo.org Sent: Tuesday, October 9, 2012 12:25:29 PM Subject: Re: [gdal-dev] S57 dataset boundary issue On Mon, Oct 8, 2012 at 10:28 PM, Nikhil Sai Parupalli nikhil.parupa...@iictechnologies.com wrote: HI All, , Thanks for the reply in below data NAME_RCNM (IntegerList) = (7:130,130,130,130,130,130,130) NAME_RCID (IntegerList) = (7:691,391,690,52,1336,1503,1512) ORNT (IntegerList) = (7:2,2,2,2,1,1,1) USAG (IntegerList) = (7:1,1,1,1,1,1,1) MASK (IntegerList) = (7:255,255,255,255,255,255,255) RCID 691 ORNT has 2 and USAG is 1 based on this data we could identify that RCID 691 is of exterior boundary with reverse direction. So if I have 1000 RCID in NAME_RCID which is vise versa for the above condition I need to display that RCIDS list as errors. So it makes 1000 conditional checks hence reducing performance. Please let us know further. Nikhil, I'm afraid I don't follow your point. Are you trying to do some sort of ring orientation validation and identify ones that don't match your expectations? And you are concerned about the performance cost? I don't know why you are doing this, and if you are, I'm not sure what I or others can do about the performance cost of checking. Best regards,-- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Software Developer ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Frank going to Google and it is not mentionned once on the list!
A quick search for frank warmerdam google on Google return 53,200 results The same search on Bing return 16,400 results But then Bing tell us that Related Search: .. Frank Sinatra, .. Frank Zappa, .. Anna Frank Some guys at Google are going to have a chuckle Congrat! Sylvain. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] OGR about s_57
Hi Frank, I know lots of people have made various levels of effort in following the S52 specification based on OGR as a feature reader. Perhaps some of them will speak up and volunteer additional information. Here's info I send to Randy. It's border line related to OGR/S57 but googler might find this useful: Old IHO's S-52 Manual at 'the Wayback Machine': http://web.archive.org/web/20030323010814/http://www.iho.shom.fr/general/ecdis/pslb03_2.pdf This manual explain how to link OGR/S-57 to S-52 for rendering. Note that the audience is ECDIS manufacturer. Note also that is old stuff. Finally note that this whole S-57/S-52 is about to be replace by S-100/S-101, an extended and XML'ised version aligned on 0GC/ISO. If all you want is color then you can find decent RGB for recent S-52 color palette by Googling. XML'ing S-57/S-52 is just an other way to serialize ENC data. There is provision in S-100/S-101 to embed GeoTIFF (for bathymetric stuff) also. So, to GDAL/OGR this new stuff is not that alien. rgds, Sylvain. --- On Tue, 9/1/09, Frank Warmerdam warmer...@pobox.com wrote: From: Frank Warmerdam warmer...@pobox.com Subject: Re: [gdal-dev] OGR about s_57 To: Randy randyqi...@hotmail.com Cc: GDAL/OGR mailing list gdal-dev@lists.osgeo.org Received: Tuesday, September 1, 2009, 9:46 PM Randy wrote: Hi, everyone, I’m now interesting in displaying ENCs. I know the OGR can support the s57 format files and it can get some data like point、line、polygon. But it cannot support the styles as Mr Frank Warmerdam told me. Now, I have such questions: 1. Where can I know what OGR does support and does not support about s57 ? Does it get the symbols(no, right?)? Randy, OGR does not read the actual graphical symbols. For instance, we might have a feature from the WRECKS layer like below with various valuable attributes, but actual wreck symbol. OGRFeature(WRECKS):2163 RCID (Integer) = 2164 PRIM (Integer) = 1 GRUP (Integer) = 2 OBJL (Integer) = 159 RVER (Integer) = 1 AGEN (Integer) = 540 FIDN (Integer) = 2135161787 FIDS (Integer) = 688 LNAM (String) = 021C7F43FBBB02B0 NAME_RCNM (IntegerList) = (1:110) NAME_RCID (IntegerList) = (1:517) ORNT (IntegerList) = (1:255) USAG (IntegerList) = (1:255) MASK (IntegerList) = (1:255) CATWRK (Integer) = 1 QUASOU (String) = 2 WATLEV (Integer) = 3 POINT (61.1031909 -32.4450159) 2. If I have got the color and symbols, How could I know which kind of color the line(or polygon or something else which I get with the help of OGR) should match with? You would normally read the S52 specification and use it to determine appropriate coloring, styling and symbolization from the attributes of a feature. I haven't actually reviewed the S52 specification, but I imagine it has rules for how to draw wrecks that might indicate different symbols depending on the CATWRK (Category of Wreck) and WATLEV (Water level effect) attributes of the feature. 3. Has anyone done such things, can you help me something? I know lots of people have made various levels of effort in following the S52 specification based on OGR as a feature reader. Perhaps some of them will speak up and volunteer additional information. 4. I know the file “IHO ECDIS Presentation Library” can help me but I don’t know how to get it, can you? Normally the IHO web site should have instructions on ordering. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Programmer for Rent ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev