Karsten,<br><br>shapelib used by OGR can handle shapefiles without the dbf files.<br>However, it uses the shx file to build the index. It may be possible to build the index by reading the shp file, but it needs non-trivial changes to the shapelib.<br>
<br><div class="gmail_quote">On Fri, Jun 8, 2012 at 5:13 AM, karsten <span dir="ltr"><<a href="mailto:karsten@terragis.net" target="_blank">karsten@terragis.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>



<div>
<div><font face="Arial">
<div><span style="FONT-FAMILY:'Verdana','sans-serif';FONT-SIZE:9pt"><span style="COLOR:#003264"></span></span><u></u><u></u><font face="Arial">Hi All, 
<br><br>I posted the qu<span>es</span>tion below in the 
PostGIS <span>email </span>and local CUGOS email 
list<span>s</span> and got some <span>good </span>input. </font><u></u></div>
<div><u></u><font face="Arial"><font>Now I wanted to determine how hard it 
<span>would </span>be to 'hack' the ogr2ogr utility 
program to be able to only load the geometries of a shape file (shp file only, 
without shx and dbf that are usually required) into PostGIS. Thu<span>s</span> only the geometry is needed and <span>a </span>unique id, the test that ogr2ogr <span>does </span>if shx and dbf are present sh<span>o</span>uld be omitted (that i<span>s</span> tha<span>t</span> 
hack <span>I</span> am talking about)<br>Any ideas on 
that if that could be accomplished with <span>by 
hacking ogr2ogr </span>without too much trouble ? <span>Or is there any other utility tool out there to get 
this done preferably without programming 
:)</span></font></font><u></u></div><u></u><font face="Arial">
<div><br>Cheers <br>Karsten <br></div>
<div>Terra GIS LTD <br></div></font><a title="http://www.terragis.net/"><font title="http://www.terragis.net/" face="Arial">www.terragis.net</font></a><u></u></font></div>
<div><u></u><span></span><span></span><font face="Arial"><span></span><span></span><font face="Arial"><span></span><span></span><font face="Arial"><span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial"><span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..<span></span><span></span><font face="Arial">.<span>..</span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></span></font></font></font></font><u></u></div>

<div><u></u><font face="Arial"><font><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span><span>>>> 
</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>I 
am working on a data upload function where for a web map a user can upload a 
shape file onto the server, the file will then be loaded via a utility into 
PostGIS e.g. using ogr2ogr or shp2pgsql. <br>Now we all know that usually a 
shape files has at least 3 files shp, shx and dbf to be complete... but 
unusually - well I was wondering if it would be possible to only use a shp file 
alone to load the geometry to PostGIS (if it is ok to lo<span>o</span>se index and attributes) <br><br>The reason is 
this would have several advantages for the work I am tying to do <br>1. the 
shape file is user provided (if will be always 'simple' polygon shapes, but due 
to that will always have non consistent attributes (i.e not the same table 
schema) which are not needed anyway for the purposes of the app <br>2. the 
geometry alone will be used to show areas of Interest for the user on the map 
(attributes are not needed, only location and extent matters) <br>3. 
inconsistencies of differing attributes will not be a problem if I could in fact 
only import the geometry to PostGIS and simply add a unique gid and user id as 
only default attributes to the PostGIS table <br>4. another advantage would be 
that only the single shp file alone would need to be uploaded to the server :) 
<span>>>>></span><br><span></span><span></span><span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..<span></span><span></span>.<span>..</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span> 
<br></font></font></div><u></u></div><br><br><br><br><font face="Tahoma"><br>=======<br>Email scanned by PC Tools - No viruses or spyware found.<br>(Email Guard: 9.0.0.888, Virus/Spyware Database: 6.19840)<br><a href="http://www.pctools.com/?cclick=EmailFooterClean_51" target="_blank">http://www.pctools.com</a><br>
=======</font>

<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>
<br>+91-9494447584<br>17.2416N 80.1426E<br>