<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 24, 2013 at 6:16 AM, Jaak Laineste (Nutiteq) <span dir="ltr"><<a href="mailto:jaak@nutiteq.com" target="_blank">jaak@nutiteq.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div>Note that not getting this type right is likely behind some of the other failures you are seeing.</div></div></div></div></div></blockquote><div><br>
</div></div><div>I now recompiled with #define HAVE_LONG_LONG 1 (manually added it to cpl_config.h) and it seems to work now. </div></div></blockquote><div><br></div><div style>Excellent!</div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<div style="word-wrap:break-word"><div> 3. Some other tweaks and changes as described in [1] to get also Swig Java bindings working</div><div><br></div><div>b) Runtime problems. Main problem is that some OGR drivers do not open some of test files, even if ogr.GetDriver() reports them. See [2] for reported the list. There is no any error message, and debugging this via Android NDK would be a bit too much for me.</div>



</div></blockquote><div><br></div></div><div>You could customize error handling to log to a file or some other suitable mechanism from gdal/port/cpl_error.cpp, and also turn on debug output.  For a logging error handler do this near the start of your program:<br>



</div><div><br></div><div>  CPLSetConfigOption("CPL_LOG", "/tmp/your.log");</div><div>  CPLPushErrorHandler(CPLLoggingErrorHandler);</div><div><br></div><div>to enable debugging output do:</div>
<div><br></div><div>  CPLSetConfigOption("CPL_DEBUG", "ON");</div><div><br></div><div>I haven't used the logging error handler for a long time so it might be quirkly/broken/wrong.</div>
<div><br></div></div></div></div></blockquote><div><br></div></div><div>I tried that now with mixed results. The file logger works with GDAL, but not with OGR. So for this specific issue could not use it. But I managed to hack at least error messages (stdout) to Android own logger, and got the info what I needed:</div>


<div><br></div><div>1. esrigeojson file - opens ok, this has own parser I guess</div><div><br></div><div>2. KML and some other files - no error message, no open. I suspect same problem as 5. below.</div></div></blockquote>
<div><br></div><div style>I'm not sure why this is.  </div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>

3. GML file:</div><div><div>ERROR 1: Unable to create Xerces C++ or Expat based GML reader, Xerces or Expat support</div></div><div>-> should add Expat or Xerces, simple (in theory)</div><div><br></div><div>4. GPX file </div>


<div><div>ERROR 6: OGR/GPX driver has not been built with read support. Expat library required</div></div><div>-> adding Expat should do it, simple</div><div><br></div><div>5. other geojson file - error:</div><div><div>


<div> ERROR 4: Unable to open EPSG support file gcs.csv. </div></div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote">
<div>This last one brings me to two questions: </div><div><br></div><div>a) where can I define folder from where the EPSG support files are read from? When I had similar problem with proj.4, then I did ugly hack (almost hardcoded) to pj_open_lib.c, and there is PROJ_LIB variable, but I could not find similar thing for GDAL. Android JNI does not provide easily packaged files for C++, but that's another story.</div>
</div></blockquote><div><br></div><div style>The location to search for can be set various ways, but the easiest in code is to call the following at startup. </div><div style><br></div><div style>CPLSetConfigOption("GDAL_DATA", "...");</div>
<div style><br></div><div style> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>b) how are gdal/osr and proj.4 related in general. If I compile gdal without proj.4 then does OSR provide some kind of lite standalone replacement for it?</div>
<span class="HOEnZb"><font color="#888888"><div><br></div><div>Jaak</div></font></span></div>
</blockquote></div><div class="gmail_extra"><br></div>Without PROJ.4 there will be no support for coordinate system transformations (ie. convert a point from lat/long to utm), but coordinate system lookups for the purposes of reading and writing files is fine.  </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Best regards,<br>-- <br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up   | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush    | Geospatial Software Developer<br>
</div></div>