[gdal-dev] GDAL compiler GDAL utility use
Hi Peter, Thank you so so much for your response! I still believe there is something wrong with my GDAL compiling or environment variable. I use ogrinfo(one of GDAL/OGR utilities) in GDAL on my Linux Windows OS, the result is the same(wrong): -Ogrinfo -ro -al -q US5TX51M.000 |more ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 //...a lot as the same as above Layer name: DSID ... Layer name:Point . Layer name:Line .. While the ogrinfo in FWTools ,the result is as follows: Layer name: DSID ... Layer name: ACHARE ... Layer name: BCNLAT ... Then, I'd like to know what else I should do when I build GDAL in a default way: cd ./configure ./make ./sudo make install What I do else until now is just set GDAL_DATA environment variable and OGR_S57_OPTIONS. And I use GDAL1.7.2 release version. Best regards, Randy -Original Message- From: Peter J Halls [mailto:p.ha...@york.ac.uk] Sent: Thursday, June 17, 2010 4:54 PM To: randy Subject: [!! SPAM] Re: [gdal-dev] problem on function OGR_FD_GetName Randy, I've not worked with your platforms but, extrapolating from my Solaris(Sparc) environment ... GDAL uses Environment Variables as an alternative to the configure script parameter list. I'm old fashioned here and prefer the parameter list, as I find it easier to debug. Having said that, these control things like the compiler to use and the additional libraries to configure: I do not think any of these are likely to affect the way OGR_FD_GetName works. Are you using the same hardware environment with different operating systems? Has Configure correctly determined the hardware environment? You can work through Config.status and Config.log to check this - if the two GDAL environments are supposed to be the same, can you diff these as a quick way of finding any differences? There are also a few Environment Variables involved at runtime eg PATH, LD_LIBRARY_PATH, ORACLE_HOME, TNS_ADMIN, and so on. The last two control the Oracle interface; the first two affect loading a program at runtime. If any of these are wrong, I would not expect execution to start or get as far as you have. On that basis, I think it unlikely that you have an Environment variable problem. I presume that you are reading the same file on each platform? The 'new' results you are reporting look to me as though the data definition is being reported instead of the feature name: could it be that you are effectively reading alternate lines? Do you have a problem prior to calling OGR_FD_GetName that may be reading the next entry in the dataset to fulfil the input request and thus giving the impression of the incorrect feature name? This could come back to the GDAL Configure results, prior to building GDAL. [Did you transfer the GDAL source directory from one platform to the other? If so, did you run a 'make clean' before building GDAL on the second, problematic platform? It is possible for bits of an old configuration to 'linger' if the clean is not run ...] Hoping there is something there that helps, Best wishes, Peter --- ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Re: GDAL compiler GDAL utility use
Hi Peter, Thank you very much! With your help,I fixed this problem! The reason is that my GDAL_DATA environment variable is not true. I set it first by the GDAL FAQ(http://trac.osgeo.org/gdal/wiki/FAQInstallationAndBuilding#HowtosetGDAL_DATAvariable) which tells me :$ export GDAL_DATA=/usr/local/share/gdal/data but I find in my default installing path,there is not data folder and all the dates is in its parent directory:/usr/local/share/gdal. So I reset my GDAL_DATA environment variable,and it works well now.I forgot my this variable value in my last Ubuntu9.04 OS,it was a long time ago.And I think the GDAL FAQ How to set GDAL_DATA variable? should change its answer. Thank you,Peter,again! Best regards, Randy Aha ... ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 ERROR 1:Invalid index :-1 I think this is where the key to your problem lies. This message, I believe, implies that the input structure does not match that expected by the driver, such that it is failing to extract key control information. The best way to get at the meaning of this is to locate where in the s57 driver this error is generated - it may be in more than one location, however. Given the condition(s) pertaining to the error, you should be able to deduce the underlying problem. It is possible to turn the internal debug on with a switch to ogrinfo / ogr2ogr: that may help. Does *any* of the output look plausible? Can you read the file successfully elsewhere - I've assumed you can? One possibility relates back to configure: has this identified the byte order correctly? I do not think these errors are going to relate to runtime environment variables, but it is possible for environment variables to override parameters to configure - I often forget to unset ORACLE_HOME, for example, which wreaks havoc with accessing the include files and then wonder why it refuses to include the Oracle driver. I do not know quite how this operates in Windows - I use Cygwin for my GDAL work there and have to be as careful as on Solaris. Best wishes, Peter //...a lot as the same as above Layer name: DSID ... Layer name:Point . Layer name:Line .. While the ogrinfo in FWTools ,the result is as follows: Layer name: DSID ... Layer name: ACHARE ... Layer name: BCNLAT ... Then, I'd like to know what else I should do when I build GDAL in a default way: cd ./configure ./make ./sudo make install What I do else until now is just set GDAL_DATA environment variable and OGR_S57_OPTIONS. And I use GDAL1.7.2 release version. Best regards, Randy -Original Message- From: Peter J Halls [mailto:p.ha...@york.ac.uk] Sent: Thursday, June 17, 2010 4:54 PM To: randy Subject: [!! SPAM] Re: [gdal-dev] problem on function OGR_FD_GetName Randy, I've not worked with your platforms but, extrapolating from my Solaris(Sparc) environment ... GDAL uses Environment Variables as an alternative to the configure script parameter list. I'm old fashioned here and prefer the parameter list, as I find it easier to debug. Having said that, these control things like the compiler to use and the additional libraries to configure: I do not think any of these are likely to affect the way OGR_FD_GetName works. Are you using the same hardware environment with different operating systems? Has Configure correctly determined the hardware environment? You can work through Config.status and Config.log to check this - if the two GDAL environments are supposed to be the same, can you diff these as a quick way of finding any differences? There are also a few Environment Variables involved at runtime eg PATH, LD_LIBRARY_PATH, ORACLE_HOME, TNS_ADMIN, and so on. The last two control the Oracle interface; the first two affect loading a program at runtime. If any of these are wrong, I would not expect execution to start or get as far as you have. On that basis, I think it unlikely that you have an Environment variable problem. I presume that you are reading the same file on each platform? The 'new' results you are reporting look to me as though the data definition is being reported instead of the feature name: could it be that you are effectively reading alternate lines? Do you have a problem prior to calling OGR_FD_GetName that may be reading the next entry in the dataset to fulfil the input request and thus giving the impression of the incorrect feature name? This could come back to the GDAL Configure results, prior to building GDAL. [Did you transfer the GDAL source directory from one platform to the other? If so, did you run a 'make clean' before building GDAL on the second, problematic platform? It is possible for bits of an old configuration
[gdal-dev] how to use docs?
Hi list, This maybe a bad question. I make docs and make install docs after installing GDAL, but then how should I use this docs file and query functions? I thought Devhelp could help me but nothing appeared on devhelp. Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] how to use docs?
Hi Ivan, The GDAL docs that you created with make docs is basically a copy of what you have on gdal.org in html format generated by Doxygen. You can also run make man and make install-man if that helps. Then how do I use this docs file,can I use it in Devhelp or man some function in terminal? I find it still doesn't work after make man and make install-man. Thanks a lot! Best regards, Randy Regards, Ivan Randy wrote: Hi list, This maybe a bad question. I make docs and make install docs after installing GDAL, but then how should I use this docs file and query functions? I thought Devhelp could help me but nothing appeared on devhelp. Best regards, Randy ___ 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] how to use docs?
Hi Ivan, Thank you for your timely response! I am not familiar with Devhelp and I unaware that GDAL uses it. From what I saw on Wikipidea it looks like an interesting resource but do you know if it can be integrated with Doxygen? It seems not. It seems need a litter more work directly from Doxygen to Devhelp. but I'm not sure about it. Does it process the same JavaDoc style annotation? If that is true I think there is a change that we might auto generate Devhelp by running a script or something like that. But if there is not a doc for querying just like MSDN in Windows, how should I get enough info about GDAL functions? Thanks! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
RE: [gdal-dev] convert s57 to shp via ogr2ogr?
Hi Frank, Thanks for your help! Yes, it works now, but I need to do lots of tedious work for finishing this converting work. Anyway, thank ogr2ogr and appreciate your patient guideline! Best regards, Randy -Original Message- Hi Frank, Thanks for your timely response! That switch is not appropriate to just transform a single layer. Do something like: ogr2ogr -skipfailures wrecks_p.shp -nlt point GB4X.000 wrecks ogr2ogr -skipfailures wrecks_l.shp -nlt linestring GB4X.000 wrecks So sorry I cannot understand it above,I use the command as follows on Linux,but it seems nothing(anything about us_p.shp or us) was produced: $ogr2ogr -skipfailures us_p.shp -nlt point US1AK90M.000 us1ak90m I don't know what the wrecks at the end of your command means, then it still brought many errors while I don't use this command-word. Any clue? Randy, The wrecks is the name of a layer from the dataset - an S57 feature class. If you do ogrinfo uslak90m.000 you will get a list of all the available layers. 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
[gdal-dev] convert s57 to shp via ogr2ogr?
Hi list, I’d like to know whether ogr2ogr could convert s57 files to ERSI shape file(.shp)? I got some errors during converting: ERROR 6:Can’t create fields of type StringList on shapefile layers. … Same as above ERROR 1:Attempt to write non-polygon LINESTRING geometry to type shapefile ……. Same as above And I use the command:”ogr2ogr �Cskipfailures -f “ESRI Shapefile” out US1AK90M.000”. Is there anything wrong about my command? Or the ogr2ogr have some defect? Thanks. Best regards, Randy ―― ―― To be frank, dream is hard to own! Fortunately, I do understand what deserves me to dedicate myself to through all my life. ―― ―― ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] convert s57 to shp via ogr2ogr?
Hi Frank, Thanks for your response! The first message indicates that there are some fields of a type that cannot be translated to shapefiles directly. With -skipfailures they should be just skipped. The second message is caused when an S-57 layer has a mixture of geometry types. Shapefiles can only have one geometry type (ie. line or point) per layer. The traditional way to address this is to do two translations for layers with a mixture of geometries, one for each geometry type. So you command is reasonable, but to translate S-57 the best that is possible you will likely need to do the translation one layer at a time, The ogr2ogr has [-clipsrclayer layer] which seems could do translation one layer at a time,but this means I should get the layername via ogrinfo first,right? and establish what geometry types each has. Rather tedious! Best regards, Randy Best regards, ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] questions about S-57
Hi Frank and list, I have several questions which are not relevant to GDAL/OGR itself, but S-57 format. Wish any hint, thanks! NO.1 I'd like to know whether PRIM is as same as NAME_RCNM? If not, what's the difference between the two? NO.2 I got some info via ogrinfo from a s-57 file(*.000). In a caution area object(CTNARE),some fields are as follows: PRIM=3---which means the object's geometry is a face, right? NAME_RCNM=130---which means the vector record's type is edge, I guess. But the next three fields should exist with a face vector record(5.1.3.3 chapter in S-57 Editon3.1 seems give this hint, but I'm not sure it's true.) ORNT=2:2,2 USAG=2:1,1 MASK=2:255,255 And another two questions: NO.1 The field value in spatial records such as NAME_RCID=2:25,413 has a prefix 2:, does it mean the field belong to spatial record not feature record? NO.2 And why one is 25,and another is 413?Does it mean 25 is the ID in spatial record and 413 is the ID in the whole record? Thanks a lot! Best regards, Randy To be frank, dream is hard to own! Fortunately, I do understand what deserves me to dedicate myself to through all my life. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
RE: [gdal-dev] questions about S-57
Hi Frank and list, Thanks for your prompt and explicit response, I think I see now. Best regards, Randy -Original Message- From: Frank Warmerdam [mailto:warmer...@pobox.com] Sent: Monday, March 15, 2010 7:09 PM To: Randy Cc: GDAL/OGR mailing list Subject: Re: [gdal-dev] questions about S-57 Randy wrote: Hi Frank and list, I have several questions which are not relevant to GDAL/OGR itself, but S-57 format. Wish any hint, thanks! NO.1 I'd like to know whether PRIM is as same as NAME_RCNM? If not, what's the difference between the two? Randy, Reviewing a WRECKS feature I see they are not, I have: PRIM (Integer) = 1 NAME_RCNM (IntegerList) = (1:110) NAME_RCID (IntegerList) = (1:498) So, RCNM is 110 (isolated node) and PRIM is 1 (point feature). From the include file: /* */ /* RCNM values.*/ /* */ #define RCNM_FE 100 /* Feature record */ #define RCNM_VI 110 /* Isolated Node */ #define RCNM_VC 120 /* Connected Node */ #define RCNM_VE 130 /* Edge */ #define RCNM_VF 140 /* Face */ /* */ /* FRID PRIM values. */ /* */ #define PRIM_P 1 /* point feature */ #define PRIM_L 2 /* line feature */ #define PRIM_A 3 /* area feature */ #define PRIM_N 4 /* non-spatial feature */ NO.2 I got some info via ogrinfo from a s-57 file(*.000). In a caution area object(CTNARE),some fields are as follows: PRIM=3---which means the object's geometry is a face, right? Yes, it means it is an area feature. NAME_RCNM=130---which means the vector record's type is edge, I guess. But the next three fields should exist with a face vector record(5.1.3.3 chapter in S-57 Editon3.1 seems give this hint, but I'm not sure it's true.) ORNT=2:2,2 USAG=2:1,1 MASK=2:255,255 Was there a question in here? And another two questions: NO.1 The field value in spatial records such as NAME_RCID=2:25,413 has a prefix 2:, does it mean the field belong to spatial record not feature record? The fields NAME_RCID and and NAME_RCNM are list fields, so the first value is the report is the count of items in the list followed by a colon, and then the list of values separated by commas. It is just a particular reporting format of the ogrinfo program. NO.2 And why one is 25,and another is 413?Does it mean 25 is the ID in spatial record and 413 is the ID in the whole record? It presumably means there are two edge objects one with RCID=25 and one with RCID=413. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] question with field name read from ogrinfo
Hi Frank and list, I have a question about field name in OGR: I read the IHO transfer standard for digital hydrographic data publication S-57 Edition 3.1-November 2000,and it tells me that one spatial record should have a Record name and its field name is [RCNM].But in ogrinfo ,it gives me a field name-NAME_RCNM. Then, I'd like to know if the ogrinfo's writer change the field name or it means the [NAME_RCNM] is on the new S-57 version while [RCNM] is just on the old version(3.1 edition)? Thanks for your time! Best regards, Randy To be frank, dream is hard to own! Fortunately, I do understand what deserves me to dedicate myself to through all my life. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
RE: [gdal-dev] question with field name read from ogrinfo
Hi Frank, Thanks for your reply! I know what you mean now, NAME_RCID can tell the difference between Feature records' RCID and Spatial Records', and it is easily to know the NAME_RCNM subfield is from Spatial Record from its prefix-NAME. Best regards, Randy -Original Message- From: Frank Warmerdam [mailto:warmer...@pobox.com] Sent: Saturday, March 13, 2010 12:51 AM To: Randy Cc: GDAL/OGR mailing list Subject: Re: [gdal-dev] question with field name read from ogrinfo I read the IHO transfer standard for digital hydrographic data publication S-57 Edition 3.1-November 2000,and it tells me that one spatial record should have a Record name and its field name is [RCNM].But in ogrinfo ,it gives me a field name-NAME_RCNM. Then, I'd like to know if the ogrinfo's writer change the field name or it means the [NAME_RCNM] is on the new S-57 version while [RCNM] is just on the old version(3.1 edition)? Randy, I always called this field NAME_RCNM so it isn't about what edition it is from. I believe it is named this because it is the RCNM extracted from the NAME field of the feature (FSPT). I presume it is used to lookup the RCNM and RCID in the set of spatial records when composing the geometry for the feature. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] GDAL installing about building openev
Randy, I think you already received other replies, but I think the problem is that an earlier step select gtkgl as a library but without actually checking properly if it was available and now the GDAL test fails because it also tries to include previous dependencies like gtkgl. So the problem isn't GDAL at all, but how gtkgl is found. Best regards, Hi Frank, Right, you're so right! Thank you so so much! The reason is that I forgot set some dependencies their proper environment path. But I have a question:How do you find the reason of my failure according to the information in config.log I gave you on last E_mail? Thanks again! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
Re: [gdal-dev] GDAL installing about building openev
Hi Frank and list, I haven't solved this problem yet.I have checked config.log and just found the info: configure:5590: Using requested GDAL_HOME of /home/randyqiu/run-time/gdal-1.6.2 configure:5605: checking for GDALOpen in -lgdal configure:5640: gcc -o conftest -O2 -I/usr/local/include -I/usr/local/include conftest.c -lgdal -lgdal -L/home/randyqiu/run-time/gdal-1.6.2/lib -lgtkgl-ldl -L/usr/local/lib 5 /usr/bin/ld: cannot find -lgtkgl collect2: ld returned 1 exit status configure:5647: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME | #define PACKAGE_TARNAME | #define PACKAGE_VERSION | #define PACKAGE_STRING | #define PACKAGE_BUGREPORT | #define HAVE_LIBDL 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_FCNTL_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define HAVE_STRING_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_VPRINTF 1 | #define USE_GNUCC 1 | #define USE_GNUCC 1 | /* end confdefs.h. */ | | /* Override any GCC internal prototype to avoid an error. |Use char because int might match the return type of a GCC |builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern C | #endif | char GDALOpen (); | int | main () | { | return GDALOpen (); | ; | return 0; | } configure:5668: result: no configure:5679: checking for GDALOpen in -lgdal configure:5742: result: no configure:5754: checking for GDALOpen in -lgdal configure:5817: result: no configure:5832: error: OpenEV requires GDAL library, but it was not found. Please download and install it. See http://www.remotesensing.org/gdal But I don't have any idea about the info.I thought there is something wrong with building GDAL since there is error info as follows although configure: exit 0 and applications in GDAL/bin work very well: conftest.cpp:19:28: error: ac_nonexistent.h: No such file or directory conftest.c:67:20: error: direct.h: No such file or directory conftest.c: In function 'main': conftest.c:41: error: 'not' undeclared (first use in this function) conftest.c:41: error: (Each undeclared identifier is reported only once conftest.c:41: error: for each function it appears in.) conftest.c:41: error: expected ';' before 'big' configure:16000: $? = 1 configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME Any suggestion? Thanks! Best regards, Randy 在 2009-11-15日的 10:39 -0500,Frank Warmerdam写道: On Sun, Nov 15, 2009 at 1:45 AM, Randy randyqi...@hotmail.com wrote: Hi list, when I ./configure... the OpenEv,the error is as follows: configure: Using requested GDAL_HOME of /home/randyqiu/run-time/gdal-1.6.2 checking for GDALOpen in -lgdal... no checking for GDALOpen in -lgdal... (cached) no checking for GDALOpen in -lgdal... (cached) no configure: error: OpenEV requires GDAL library, but it was not found. Please download and install it. See http://www.remotesensing.org/gdal But I have install GDAL successfully and there are four files(bin include lib share)in the path /home/randyqiu/run-time/gdal-1.6.2. Randy, I'm not clear on what GDAL related options you passed to configure. You may find it helpful to open config.log in an editor and look for GDALOpen, then examine that area of the log for a more specific idea of why things failed. Best regards, ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
答复: [gdal-dev] charge for IHO EC DIS Presentation Library(digital version, a CD-ROM)
Hi Sylvain and list, Thanks for your reply. Two questions. 1. However, I don’t understand you very well. Exactly, what's mean by contrib ( Try in OpenEV/contrib CVS). Yes, I have download the OpenEv source code by SVN on SourceForge website. Then how should I join this project or what should I do next step? I guess this question sounds a little foolish, but please answer it since I have never done anything about open source code project before. 2. This is an old question: should I charge for IHO ECDIS Presentation Library(including that CD-Rom)? If so, how should I contact with them? I have sent email to them by contact form on that official website http://www.iho-ohi.net/english/home/ . Thanks a lot again in advance! Best regards, Randy -邮件原件- 发件人: s duclos [mailto:sylvain_duc...@yahoo.com] 发送时间: 2009年10月20日 0:23 收件人: Randy 主题: Re: [gdal-dev] charge for IHO ECDIS Presentation Library(digital version, a CD-ROM) Hi Randy, Try in OpenEV/contrib CVS. This could get you started. The idea was to code a plugin for OpenEV. OpenEV does the rendering. GDAL load the data and OpenEV render it. If you want to build it try the glx target first. rgds, Sylvain. --- On Sun, 10/18/09, Randy randyqi...@hotmail.com wrote: From: Randy randyqi...@hotmail.com Subject: [gdal-dev] charge for IHO ECDIS Presentation Library(digital version, a CD-ROM) To: GDAL/OGR mailing list gdal-dev@lists.osgeo.org Received: Sunday, October 18, 2009, 10:22 AM Hi list, Exactly, this question should not be here since it isn’t about the GDAL/OGR. However, I know there are people here who has made displaying ENCs. And my question is: Is it necessary for me to charge for a IHO ECDIS Presentation Library CD-ROM? I mean there are something like look-up tables、CIE2RGB procedure, etc. which are necessary for displaying ENCs, and anything else which can replace the CD-ROM? If not, how can I buy it and who I should contact with? Thanks a lot for your suggestion! Best regards, Randy -Inline Attachment Follows- ___ 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
答复: [gdal-dev] different result of ogrinfo between GDAL/OGR and FWTools
Hi Yilmaz, Thank you very much!! Now, my application and ogrinfo from GDAL/OGR works well after setting GDAL_DATA environment variable and changing the version. Frank is right, the question should be needed in FAQ. I think this is my fault and I'm sorry to disturb everyone. And I want to say Thank you! to Frank、Mateusz、Chaitanya and Jukka. -邮件原件- 发件人: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] 代表 Yilmaz Arslanoglu 发送时间: 2009年10月11日 21:59 收件人: gdal-dev@lists.osgeo.org 主题: [?? Probable Spam] [gdal-dev] different result of ogrinfo between GDAL/OGR and FWTools Hi Randy; Did you check that you set the GDAL_DATA configuration correctly? If it is the case, then here is the previous answer from Frank: This might be accomplished by setting the GDAL_DATA configuration variable either via the environment or the CPLSetConfigOption() function. Were you using ogrinfo from an environment like OSGeo4W or FWTools that sets up the environment carefully? And my question was: - Hello everybody; First of all, I would like to say that I am quite new in S-57 format and GDAL/OGR libraries. As a starting point, I downloaded the source codes and built the whole GDAL library on my computer, using the nmake of Visual Studio 2008. Now: poDS = OGRSFDriverRegistrar::Open( US5LA24M.000, FALSE ); for (int i = 0; i poDS-GetLayerCount(); i++) printf(layer %d: %s\n, i, poDS-GetLayer(i)-GetLayerDefn()-GetName()); When I try to list the layer names of a datasource with the code snippet above, I get the following result: layer 0: DSID layer 1: Point layer 2: Line layer 3: Area layer 4: Meta However, the utility application ogrinfo gives a quite different result as follows: (when run with command ogrinfo US5LA24M.000 ) 1: DSID (None) 2: ACHARE 3: BCNLAT (Point) 4: BCNSPP (Point) 5: BUISGL ... ... ... 49: M_QUAL (Polygon) 50: C_ASSO (None) I examined the source code of ogrinfo under the gdal-1.6.2\apps\ directory, however, I could not find a difference in terms of listing the layers in the dataset. What could be the problem, is there a point that I'm missing? ___ 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] different res ult of ogrinfo between GDAL/OGR and FWTools
Chaitanya, Thanks you, Chaitanya! To be frank, I don’t understand what you mean. Could you give me some more explicit guidance and where I should change the version option? I use the latest stable GDAL/OGR release version-1.6.2 and FWTools-2.4.5, but ogrinfos from them result in different results. And what I get from my own application based on OGR equal with what ogrinfo of GDAL/OGR get. However, it lost something comparing with FWTools’s ogrinfo. Besides that, I find the environment variable “OGR_S57_OPTIONS“ doesn’t work and the result didn’t change after I set the variable and restart my PC. Anyone knows why? Thanks again!! Best regards, Randy 发件人: Chaitanya kumar CH [mailto:chaitanya...@gmail.com] 发送时间: 2009年10月11日 15:15 收件人: Randy 抄送: GDAL/OGR mailing list 主题: [?? Probable Spam] Re: [gdal-dev] different result of ogrinfo between GDAL/OGR and FWTools Randy, Perchance, the versions were different. Try the --version option. On Sun, Oct 11, 2009 at 11:55 AM, Randy randyqi...@hotmail.com wrote: Hi list, I find the ogrinfo which GDAL/OGR source code produced cannot get all fields(such as attribute fields) of a feature(s_57), while the ogrinfo in fwtools can make it. Anyone knows its reason? Thanks in advance! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- Best regards, Chaitanya kumar CH. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
答复: Re: [gdal-dev] different result of ogrinfo between GDAL/OGR and FWTools
Mateusz, Thank you and Jukka! We know there is a ogrinfo application in GDAL/OGR after building GDAL from source on windows and also the FWTools has one too. When I use ogrinfo of FWTools by command lineogrinfo -ro -al -q mys_57file. 000 |more, what I got was as follows(just some part of it): Layer name: BCNSPP OGRFeatureBCNSPP:6 RCID Integer=7 PRIMInteger=1 GRUPInteger=2 OBJLInteger=9 RVERInteger=1 AGENInteger=550 FIDNInteger=2738 LNAMString=022608917DEF0AB2 LNAM_REFSStringList=1: 022608917DEF0AB2 LNAME_RINDIntegerList=1:2 BCNSHP Integer=NULL CATSPMString=27 COLOURString= COLPATString=NULL CONDTNInteger=NULL CONRADInteger=NULL CONVISInteger=NULL DATENDInteger=NULL DATSTAInteger=NULL POINT-177.6390101 68.328550007 Then I use the ogrinfo from GDAL/OGR, the following was what I could got: Layer name: Point OGRFeaturePoint:6 RCID Integer=7 PRIMInteger=1 GRUPInteger=2 OBJLInteger=9 RVERInteger=1 AGENInteger=550 FIDNInteger=2738 LNAMString=022608917DEF0AB2 LNAM_REFSStringList=1: 022608917DEF0AB2 LNAME_RINDIntegerList=1:2 POINT-177.6390101 68.328550007 Yes, maybe you've see the last one lost a feature's attribute subfield like CATSPM. And when I retrieve feature's fields in my own application, I couldn’t get attributes' fields either. Thanks for your care about my problem and thanks in advance! Best Regards, Randy -邮件原件- 发件人: Mateusz Loskot [mailto:mate...@loskot.net] 发送时间: 2009年10月11日 20:43 收件人: Randy 抄送: GDAL/OGR mailing list 主题: [?? Probable Spam] Re: [gdal-dev] different result of ogrinfo between GDAL/OGR and FWTools Randy wrote: Hi list, I find the ogrinfo which GDAL/OGR source code Which version? There are number of versions of GDAL thus number of versions of ogrinfo. produced cannot get all fields(such as attribute fields) of a feature(s_57), while the ogrinfo in fwtools can make it. If you have problem with any particular command and its results, it is almost mandatory to provide example of commands and their results so everybody can see how the problem leaks. Otherwise, it's not really possible to help. Anyone knows its reason? No reason, unless you provide more precise information http://catb.org/~esr/faqs/smart-questions.html#beprecise Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] ogrinfo ends its work as soon as it starts
Hi list, I want to get all fields and their corresponding values of a feature by using function:OGRFeature::GetFieldAsString(). Then, I got RCID 7 PRIM 1 GRUP 2 OBJL 9 RVER 1 AGEN 550 FIND 143752687 FIDS 2738 LNAM 022608917DEF0AB2 LNAM_REFS (1:022608917DD60AB2) ... But I fail to retrieve feature's attribute field. For instance, when I got a WRECKS which was indicated by OBJL = 159, I should be able to get its attribute field like CATWRK = . QUASOU = . WATLEV = . Under Mr Chaitanya's guidance, I set environment variable OGR_S57_OPTIONS = RETURN_LINKAGES=ON,RETURN_PRIMITIVE=ON,RETURN_REFS=ON, but it doesn't work very well and I still got nothing relevant attribute field info. Therefore, I doubt there is something wrong with my ENC file and want to use ogrinfo.exe for testing. However, the window disappear as soon as it appear when I dblclick it and so does some other application like gdalwarp.exe. Anyone could give me suggestion? Best Regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
答复: [gdal-dev] Why cannot I get all fields from s57 files with m ethod GetFieldAsString?
Mr Chaitanya and list, You are so kind and help me again and again. Thanks for your help very much! Now, I can get more fields of a feature like ORNT、USAG after setting environment variable OGR_S57_OPTIONS = RETURN_LINKAGES=ON,RETURN_PRIMITIVE=ON,RETURN_REFS=ON. However, I don’t think I've got the feature's attribute field. For instance, I got a point symbol and its OBJL=159 which means it was a Wreck symbol and I thought I should get some info like CATWRK=.. QUASOU=...if I can get its attribute field. Then can you tell me whether I can do something else for this? Thanks a lot! Best Regards, Randy -邮件原件- 发件人: Chaitanya kumar CH [mailto:chaitanya...@gmail.com] 发送时间: 2009年9月26日 20:51 收件人: Randy 抄送: GDAL/OGR mailing list 主题: Re: [gdal-dev] Why cannot I get all fields from s57 files with method GetFieldAsString? Randy, You need to set the environment variable OGR_S57_OPTIONS = RETURN_LINKAGES=ON for the driver to return the FSPT group attributes. It is described in http://www.gdal.org/ogr/drv_s57.html 2009/9/26 Randy randyqi...@hotmail.com: Hi list, Under Mr Frank and Mr Chaitanya’s guidance, I try to get every feature’s field(including its name and value). But I find that I cannot get all fields. The following is my code snippet(in MFC): CString strEnd=”\r\n”; int nFieldCount=0; for(nFieldCount=0;nFieldCountpoFeature-GetFieldCount();nFieldCount++) { poFieldDefn=poFeature-GetFieldDefnRef(nFieldCount); fieldName=poFieldDefn-GetNameRef(); fileFieldAttr.Write(fieldName,strlen(fieldName)); outputFieldAttr=poFeature-GetFieldAsString(nFieldCount); fileFieldAttr.Write(outputFieldAttr+strEnd,strlen(outputFieldAttr)+2); } Then, what I got was as follows: RCID3 PRIM1 GRUP2 OBJL9 RVER1 AGEN550 FIDN344289455 FIDS2233 LNAM0226148570AF08B9 LNAM_REFS(2:02261485702E08B9,02261485703208B9) FFPT_RIND(2:2,2) RCID4 PRIM1 GRUP2 OBJL39 It means that I didn’t get the feature’s attribute field(ATTF) like ATTL、ATVL and feature’s FSPT field(Feature Record to Spatial Record Pointer) like ORNT、USAG、MASK. Then who can tell me what’s wrong with my code? Thanks a lot!!! Best Regards, Randy. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- Best regards, Chaitanya kumar CH. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] Why cannot I get all fields from s57 files with method GetFieldAsString?
Hi list, Under Mr Frank and Mr Chaitanya’s guidance, I try to get every feature’s field(including its name and value). But I find that I cannot get all fields. The following is my code snippet(in MFC): CString strEnd=”\r\n”; int nFieldCount=0; for(nFieldCount=0;nFieldCountpoFeature-GetFieldCount();nFieldCount++) { poFieldDefn=poFeature-GetFieldDefnRef(nFieldCount); fieldName=poFieldDefn-GetNameRef(); fileFieldAttr.Write(fieldName,strlen(fieldName)); outputFieldAttr=poFeature-GetFieldAsString(nFieldCount); fileFieldAttr.Write(outputFieldAttr+strEnd,strlen(outputFieldAttr)+2); } Then, what I got was as follows: RCID3 PRIM1 GRUP2 OBJL9 RVER1 AGEN550 FIDN344289455 FIDS2233 LNAM0226148570AF08B9 LNAM_REFS(2:02261485702E08B9,02261485703208B9) FFPT_RIND(2:2,2) RCID4 PRIM1 GRUP2 OBJL39 It means that I didn’t get the feature’s attribute field(ATTF) like ATTL、 ATVL and feature’s FSPT field(Feature Record to Spatial Record Pointer) like ORNT、USAG、MASK. Then who can tell me what’s wrong with my code? Thanks a lot!!! Best Regards, Randy. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] How to use OGRField and what does its contents mean?
Hi everyone, Sorry to interrupt you! I’m a new boy in OGR and s_57. I feel that there is no very explicit introduction about OGR’s details. Now, I don’t know where should I use OGRFiled since I don’t understand its details such as Set、Binary、Date in S_57. Anyone can explain it for me? I read OGR’s open source code, but it doesn’t seem like it gives us enough information and notation. Besides that, anyone could tell me where I can find the more explicit introduction about OGR, I mean almost each part of the OGR? Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] which function can fetch some supplementary(but necessary) information of geometry from s-57 file?
Hi all, 1. For instance, as respect to “point” in s-57 files, I can get its position with function “GetX” and “GetY” in OGR. However, I don’t know how to get other information about this “point” . I think at least the point should tell me which symbol was placed in this position. I don’t find such function in class “OGRPoint”, then does such function exist and if the answer is yes, which one is it? 2. As respect to a “line” or “polygon”, I assume it has information like “ the line indicates depth contour”、”the polygon indicates Harbor area”… Then, I can draw them with appropriate color according to these information. Which function can tell me this? Thanks, your answer will be appreciated!! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
答复: Re: [gdal-dev] which function can fetch some supplementary(but necessary) information of geometry from s-57 file?
Chaitanya kumar CH, Thanks a lot! Yes, I know I should get other informaion from OGRLayer、OGRFeature、etc. But can you tell me which functions can answer my two questions? -邮件原件- 发件人: Chaitanya kumar CH [mailto:chaitanya...@gmail.com] 发送时间: 2009年9月11日 23:40 收件人: Randy 抄送: GDAL/OGR mailing list 主题: [?? Probable Spam] Re: [gdal-dev] which function can fetch some supplementary(but necessary) information of geometry from s-57 file? Randy, OGRPoint is a geometry, which is stored as a part of a feature in a layer of the dataset. Any other information about the geometry is usually acquired from the OGRLayer and other fields in the OGRFeature. Hope this helps. 2009/9/11 Randy randyqi...@hotmail.com: Hi all, 1. For instance, as respect to point in s-57 files, I can get its position with function GetX and GetY in OGR. However, I don't know how to get other information about this point . I think at least the point should tell me which symbol was placed in this position. I don't find such function in class OGRPoint, then does such function exist and if the answer is yes, which one is it? 2. As respect to a line or polygon, I assume it has information like the line indicates depth contour、the polygon indicates Harbor area... Then, I can draw them with appropriate color according to these information. Which function can tell me this? Thanks, your answer will be appreciated!! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev -- Best regards, Chaitanya kumar CH. ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
[gdal-dev] OGR about s_57
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?)? 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? 3. Has anyone done such things, can you help me something? 4. I know the file “IHO ECDIS Presentation Library” can help me but I don’t know how to get it, can you? Thanks with your help and suggestion! Best regards, Randy ___ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev
FW: [gdal-dev] converting epsg:4326 coordinates to spherical mercator (google maps) epsg:900913
I think EPSG changed their minds last Feb This appears to be the new one: http://www.epsg-registry.org/export.htm?gml=urn:ogc:def:crs:EPSG::3857 EPSG:3785 shows isdeprecated true since Feb http://www.epsg-registry.org/export.htm?gml=urn:ogc:def:crs:EPSG::3785 Of course subject to further notice from EPSG? I don't know how many projects reflect the change though. This is pretty close: private Point Mercator(double lon, double lat) { /* spherical mercator for Google, VE, Yahoo etc * epsg:900913 R= 6378137 * x = longitude * y= R*ln(tan(pi/4 + latitude/2) */ double x = 6378137.0 * Math.PI / 180 * lon; double y = 6378137.0 * Math.Log(Math.Tan(Math.PI/180*(45+lat/2.0))); return new Point(x,y); } randy -Original Message- From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Jean-Claude REPETTO Sent: Saturday, May 30, 2009 11:33 AM To: gdal-dev@lists.osgeo.org Cc: John Mitchell Subject: Re: [gdal-dev] converting epsg:4326 coordinates to spherical mercator (google maps) epsg:900913 John Mitchell a écrit : Hi, If I have a lon,lat decimal degree epsg:4326 coordinate how do I convert it to spherical mercator (google maps) epsg:900913? epsg:900913 is obsolete. The correct EPSG code is 3785. You can use cs2cs from the PROJ4 project to do the conversion. HTH, Jean-Claude ___ 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] ogr2ogr C#
Or do something ugly like use a .asmx to call your ogr2ogr cmdline as a Process: using System; using System.Web.Services; using System.Text; using System.IO; using System.Diagnostics; using System.Threading; using System.Security.Permissions; [WebService(Namespace = http://www.myserver.com/ShpView;)] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Web.Script.Services.ScriptService] [SecurityPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)] public class RunTranslate : System.Web.Services.WebService { private static string basepath = E:/ShpView/; private static string pass = pass; private static string db = DBname; public RunTranslate () { } private delegate string StringDelegate(); [WebMethod] public string PostGISLoadCommand(string shp, string epsg) { string fileName = E:/ShpView/ogr/bin/ogr2ogr; string arguments = -f PostgreSQL PG:\user=user dbname=+db+ host=localhost password=+pass+ port=5432\ + basepath + /shpview/data/shape/ + shp + .shp -a_srs \ + epsg + \ -overwrite; return Run(fileName, arguments); } private static string Run(string fileName, string arguments) { string results = ; string error = ; Process cmdLineProcess = new Process(); using (cmdLineProcess) { cmdLineProcess.StartInfo.FileName = fileName; cmdLineProcess.StartInfo.Arguments = arguments; cmdLineProcess.StartInfo.UseShellExecute = false; cmdLineProcess.StartInfo.CreateNoWindow = true; cmdLineProcess.StartInfo.RedirectStandardOutput = true; cmdLineProcess.StartInfo.RedirectStandardError = true; if (cmdLineProcess.Start()) { StringDelegate outputStreamAsyncReader = new StringDelegate(cmdLineProcess.StandardOutput.ReadToEnd); StringDelegate errorStreamAsyncReader = new StringDelegate(cmdLineProcess.StandardError.ReadToEnd); IAsyncResult outAR = outputStreamAsyncReader.BeginInvoke(null, null); IAsyncResult errAR = errorStreamAsyncReader.BeginInvoke(null, null); if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) { while (!(outAR.IsCompleted errAR.IsCompleted)) { Thread.Sleep(10); } } else { WaitHandle[] arWaitHandles = new WaitHandle[2]; arWaitHandles[0] = outAR.AsyncWaitHandle; arWaitHandles[1] = errAR.AsyncWaitHandle; if (!WaitHandle.WaitAll(arWaitHandles)) { error = String.Format(Command line aborted: {0}, fileName); } } results = outputStreamAsyncReader.EndInvoke(outAR); error = errorStreamAsyncReader.EndInvoke(errAR); if (!cmdLineProcess.HasExited) { cmdLineProcess.WaitForExit(); } } else { error = String.Format(Could not start command line process: {0}, fileName); } cmdLineProcess.Close(); } return Done: + error + + results; } } From: gdal-dev-boun...@lists.osgeo.org [mailto:gdal-dev-boun...@lists.osgeo.org] On Behalf Of Tamas Szekeres Sent: Friday, March 27, 2009 3:39 AM To: Sune Dogan, LIFA A/S Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] ogr2ogr C# Hi, You'll have to re-implement the logic in ogr2ogr.cpp by using the ogr_csharp.dll. Refer to the following thread for more information: http://thread.gmane.org/gmane.comp.gis.gdal.devel/11789 Best regards, Tamas 2009/3/27 Sune Dogan, LIFA A/S s...@lifa.dk Hi Im developing a .NET C# project and need to convert from GML to ESRI Shape Simply i want to run this command: ogr2ogr -skipfailures -f ESRI Shapefile C:\shapefile.shp c:\gmlfile.gml which works fine from the FWTool Command tool. But i just want to do i in my application, can any one help me? Thanks :) ___ 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