<div>Here is ogrinfo returned:</div>
<div>INFO: Open of `MSSQL:server=ELMER;database=HT_2011_10;trusted_connection=yes'<br> using driver `MSSQLSpatial' successful.</div>
<div> </div>
<div>Here is my revised command:</div>
<div>ogr2ogr -overwrite -s_srs EPSG:32002 -t_srs EPSG:4326 -f MSSQLSpatial "MSSQL:server=ELMER;database=CENSUS_2010;trusted_connection=yes" "MSSQL:server=ELMER;database=HT_2011_10;trusted_connection=yes;tables=dbo.qaBtcSubLocs(xloc),dbo.qaBtcSubLocs(yloc)" -sql "SELECT xloc,yloc, spid FROM dbo.qaBtcSubLocs" -nln "btcSubLocs" </div>
<div> </div>
<div>And here are the errors produced:</div>
<div>ERROR 1: Column type float is not supported for geometry column.<br>ERROR 1: Column type float is not supported for geometry column.<br><br>Thx for your help. I've read every article I can google, but just haven't found the right combination of flags to get this to work.</div>
<div> </div>
<div>Fred</div>
<div> </div>
<div class="gmail_quote">On Thu, Nov 17, 2011 at 9:35 AM, Chaitanya kumar CH <span dir="ltr"><<a href="mailto:chaitanya.ch@gmail.com">chaitanya.ch@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Fred,<br><br>Check if your source table is being read correctly.<br>Use ogrinfo.<br><span style="FONT-FAMILY: courier new, monospace">ogrinfo -al "MSSQL:server=ELMER;database=HT_2011_10;trusted_connection=yes"</span><br>
<br>OGR doesn't read the MSSQL geometries if the source table doesn't have an entry in the geometry_columns table. You can bypass this by using the 'Tables' parameter in the connection string[1].<br><br>[1]: <a href="http://www.gdal.org/ogr/drv_mssqlspatial.html" target="_blank">http://www.gdal.org/ogr/drv_mssqlspatial.html</a><br>
<br>
<div class="gmail_quote">
<div>
<div></div>
<div class="h5">On Thu, Nov 17, 2011 at 9:28 PM, Fred Jones <span dir="ltr"><<a href="mailto:fredjonze@gmail.com" target="_blank">fredjonze@gmail.com</a>></span> wrote:<br></div></div>
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div></div>
<div class="h5">
<div>This is what I have so far. Back to where I started. The table is created in CENSUS_2010 spatial database, but the ogr_geometry column is null. No error.</div>
<div> </div>
<div>ogr2ogr -overwrite -s_srs EPSG:32002 -t_srs EPSG:4326 -f MSSQLSpatial "MSSQL:server=ELMER;database=CENSUS_2010;;trusted_connection=yes" "MSSQL:server=ELMER;database=HT_2011_10;trusted_connection=yes" -sql "SELECT xloc,yloc, spid FROM dbo.qaBtcSubLocs" -nln "btcSubLocs" <br>
</div>
<div>The geometry_columns table is:</div>
<div> </div>
<div>f_table_catalog f_table_schema f_table_name f_geometry_column coord_dimension srid geometry_type<br>CENSUS_2010 dbo btcsublocs ogr_geometry 2 4326 GEOMETRY</div>
<div><br><font color="#888888">Fred</font></div>
<div>
<div></div>
<div>
<div> </div>
<div class="gmail_quote">On Thu, Nov 17, 2011 at 1:48 AM, Luca Sigfrido Percich <span dir="ltr"><<a href="mailto:sigfrido@tiscali.it" target="_blank">sigfrido@tiscali.it</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi Fred,<br><br>Il giorno mer, 16/11/2011 alle 10.11 -0700, Fred Jones ha scritto:<br>
<div>> Hi Sig,<br>><br>> I have a SQL table temp_sublocs_btc with the MT State Plane x and y as<br>> the first columns in the table. CENSUS_2010 is a sql spatial database.<br>><br>> This is the command I have so far. When I execute it, I just get the<br>
> help returned, no error:<br>><br>> ogr2ogr -overwrite -s_srs EPSG:32100 -t_srs EPSG:4326 -f<br>> "MSSQL:server=ELMER;database=CENSUS_2010;trusted_connection=yes"<br>> "MSSQL:server=ELMER;database=HT_2010_10;tables=temp_sublocs_btc;trusted_connection=yes"<br>
><br>> What am I doing wrong?<br><br></div>Please remember to always post the error messages otherwise we won't be<br>able to understand. Before the usege text you should see an error<br>message.<br><br>I never worked with ogr and MSSQL, but I guess that the problem is that<br>
you should separate the output format specification (-f "MSSQL") and<br>the server connection string.<br><br>Try:<br>
<div><br>ogr2ogr -overwrite -s_srs EPSG:32100 -t_srs EPSG:4326 -f "MSSQL"<br>"MSSQL:server=ELMER;database=CENSUS_2010;trusted_connection=yes"<br>"MSSQL:server=ELMER;database=HT_2010_10;tables=temp_sublocs_btc;trusted_connection=yes"<br>
<br></div>assuming that tables=temp_sublocs_btc allows you to select the input<br>layer.<br><br>Regarding the creation of point, in PostGIS I would simply insert the X<br>and Y coords in two float fields of the target table, and issue a<br>
<br>update CENSUS_2010.temp_sublocs_btc set geom =<br>ST_Transform(ST_SetSRID(ST_MakePoint(x, y), 32100), 4326)<br><br>Which means create a point with x, y, set its SRID to state plane, then<br>transform it into WGS84, then store it in the geom column of your table<br>
(the geometry column of which should have been created in WGS84 SRS).<br><br>I don't know the corresponding function in MSSQL for ST_MakePoint etc...<br>you should refer to the documentation<br><br>I never tried this! I don't know if you can do the transformation<br>
directly with the -sql clause of ogr2ogr or with other options, please<br>try and let us know.<br><br>Sig<br><br><br><br><br><br><br><br><br>_____________<br>PRIVACY<br>Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema e a distruggere le varie copie o stampe, dandone gentilmente comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 2002/58/CE).<br>
<br>PRIVACY<br>Le informazioni contenute in questo messaggio sono riservate e confidenziali. Il loro utilizzo e' consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora Lei non fosse la persona a cui il presente messaggio è destinato, La invitiamo ad eliminarlo dal Suo Sistema e a distruggere le varie copie o stampe, dandone gentilmente comunicazione all’indirizzo mail del mittente. Ogni utilizzo improprio e' contrario ai principi del D.lgs 196/03 e alla legislazione europea (Direttiva 2002/58/CE).<br>
</blockquote></div><br></div></div><br></div></div>
<div class="im">_______________________________________________<br>gdal-dev mailing list<br><a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">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>
</div></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br><a href="tel:%2B91-9494447584" target="_blank" value="+919494447584">+91-9494447584</a><br>17.2416N 80.1426E<br>
</font></blockquote></div><br>