<div dir="ltr"><div>Does the CreateDataSource for filegeodb support filename.gdb with long path before<br><br>CreateDataSource("D:\\temp\\212121\\121212134345\\sample.gdb",NULL);<br></div>Gane<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 5, 2016 at 3:58 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le mardi 05 janvier 2016 11:13:38, Gane R a écrit :<br>
> Can send the full python script of above so I can verify that I am on right<br>
> track.<br>
<br>
</span>Not sure to understand if you ask me to provide the full python script (what I<br>
put in my previous email was the full script) or if you intended to provide me<br>
with a python port of your C++ code.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Gane<br>
><br>
> On Tue, Jan 5, 2016 at 3:40 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>><br>
><br>
> wrote:<br>
> > Le mardi 05 janvier 2016 10:54:57, Gane R a écrit :<br>
> > > gdal version gdal-1.11.3 - Filegeodbversion 1.4<br>
> > > {<br>
> > > OGRSFDriverRegistrar    *poR;                    //Pointer to hold the<br>
> > > driver registration<br>
> > > OGRSFDriver                *poDriver;<br>
> > > OGRDataSource            *poODS;<br>
> > > OGRRegisterAll();<br>
> > > poR = OGRSFDriverRegistrar::GetRegistrar();<br>
> > > poDriver = poR->GetDriverByName("FileGDB");<br>
> > > poODS = poDriver->CreateDataSource("sample1.gdb",NULL);<br>
> > > /*<br>
> > > Here adding layeres and fields and geom<br>
> > > Finnally closing the dataset OGRDataSource::DestroyDataSource( poODS );<br>
> > > *OGRCleanup not called.*<br>
> > > */<br>
> > > }<br>
> > > *First time the code works fine, and the second time different .gdb<br>
> > > name the code crashes at createDatasource.*<br>
> > ><br>
> > > *This is a snippet of code, I get crash at CreateDataSource second time<br>
> ><br>
> > for<br>
> ><br>
> > > another filename, this code I am trying to put inside a DLL*<br>
> > ><br>
> > >  *features created are destroyed.OGRFeature::DestroyFeature( poFeature<br>
> ><br>
> > );*<br>
> ><br>
> > > Do I use the API correctly? any suggestions, What the cause of this<br>
> > > crash<br>
> ><br>
> > Difficult to say without a full reproducer.<br>
> ><br>
> > I've just tested the below Python script with the 1.11 branch and FileGDB<br>
> > 1.4<br>
> > on Linux and it works fine:<br>
> ><br>
> > from osgeo import ogr<br>
> > from osgeo import osr<br>
> ><br>
> > for i in range(10):<br>
> >     ds = ogr.GetDriverByName('FileGDB').CreateDataSource('test%d.gdb'% i)<br>
> >     srs = osr.SpatialReference()<br>
> >     srs.ImportFromEPSG(4326)<br>
> >     lyr = ds.CreateLayer('test', geom_type = ogr.wkbPoint, srs = srs)<br>
> >     lyr.CreateField(ogr.FieldDefn('id', ogr.OFTInteger))<br>
> >     f = ogr.Feature(lyr.GetLayerDefn())<br>
> >     f['id'] = 1<br>
> >     f.SetGeometry(ogr.CreateGeometryFromWkt('POINT (2 49)'))<br>
> >     lyr.CreateFeature(f)<br>
> ><br>
> > --<br>
> > Spatialys - Geospatial professional services<br>
> > <a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</div></div></blockquote></div><br></div>