SQL Server ogr2ogr batch unable to access ogr_MSSQLSpatial.dll
I have an ogr2ogr batch file that reprojects SQL data into a new SQL Server table.
It works fine when I run the bat file manually but it fails if I run the bat file via a SQL Server stored procedure. I have given the
gdal folders SQL Service permissions and
xp_CommandShell is also enabled. I'm using
EXECUTE xp_CMDShell 'blah'
in the T-SQL script.
For some reason the
ogr_MSSQLSpatial.dll causes it to fail.
ERROR 1: Can't load requested DLL: Z:\BroadSpectrumSQLTreeExtract\ogr2ogr\gdalplugins\ogr_MSSQLSpatial.dll
If I remove this dll the script runs via SQL but it means I need to add extra commands that the dll must take care of, such as setting source coordinate system. I haven't managed to get it working 100%. The furthest I got to was producing the reprojected table but the geometry field is empty.
The DLL does contain SQL commands to the system tables. Could this be a SQL Server security issue stopping it from working?
See also questions close to this topic
Multiple Dropdown List trigger and data Showing in table in mvc 5
I am new in C# on mvc 5. I am working on a mvc 5 project with sql server. I design my page with bootstrap having 4 drop-down list and a table like the image . In the image you can see two list are disabled, i have indicated that when I select a value from Code BooK For list than I will get all the category group in Code Group Drop down list, If I select group value from Code Group It will show all the data from sql databse under the code group value.
I have tried ajax and jQuery but hanging how I Should deal with action, request and on-change triggering.Code Book SUBSIDIARY / DETAILS CODE BOOK SUBSIDIARY / DETAILS CODE BOOK Boston Ohaio New York Washington Code Book For Alabama Boston Ohaio New York Washington
Code Group Alabama Boston Ohaio New York Washington Code level Details Level Name View Code View View View View Change
</form> </div> </div> <div class="table-responsive"> <table style="padding-top:2px;" class="table table-bordered datatable" id="table-4"> <thead> <tr> <th style="width:2%; text-align:center;">SN</th> <th style="width:8%">Action</th> <th style="width:2%">Sub</th> <th style="width:10%">Code</th> <th style="width:46%">Description Code</th> <th style="width:5%">Unit</th> <th style="width:9%">Sub Type</th> <th style="width:10%">Remarks</th> </tr> </thead> <tbody> <tr class="odd gradeX"> <td>1</td> <td> <a href="#" class="btn btn-default btn-sm btn-icon icon-left"> <i class="entypo-pencil"></i> Edit </a> </td> <td>27-</td> <td>01-0001-0001</td> <td>ATIKUR Rahaman</td> <td>Blank</td> <td>Type</td> <td>GOOD</td> </tr>
I need help to complete this. Please let me know any other information needed.
Thanks in Advance
check a column value on insert inside trigger sql server
I want to create an (after insert)trigger which will check a column value, based on some condition I want to do some action. so how to get insert queries values inside the trigger.
Sql Server: Remove duplicates in exchangeable columns
I have this query:
select OSFES97.CodeId,OSFBA97.CodeId, OSFES97.ReceiveDate from StockArchives OSFES97 inner join StockArchives OSFBA97 on OSFBA97.ReceiveDate = OSFES97.ReceiveDate where OSFES97.CodeId<>OSFBA97.CodeId
its result is like:
CodeId CodeId ReceiveDate ------------------------------------------ 1 2 2019-01-13 15:55:20.537 2 1 2019-01-13 15:55:20.537 1 2 2019-01-13 15:55:30.537 2 1 2019-01-13 15:55:30.537
as the following records for my use considered duplicate (if they have same
ReceiveDate), I want to remove one of them.
and achieve this:
CodeId CodeId ReceiveDate ------------------------------------------ 1 2 2019-01-13 15:55:20.537 1 2 2019-01-13 15:55:30.537
How do I merge a folder full of kmls into a single Kml or kmz? python - Ogr2ogr
I am trying to create a code that takes a folder full of kmls and converts them into a kml. Is there anyway to also change the default color for all kmls and transparency?
How to fix 'JSON parsging error: continue (at offeset XXXX)' error from ogr2ogr
I have a 25 GB GeoJSON I want to convert into 10x10 degree rasters (tifs) covering most of the land on earth, with the rasters' values a particular field in the GeoJSON. My plan was to convert the GeoJSON into a PostGIS table using ogr2ogr, then convert the PostGIS table into 10x10 degree tiles. However, I'm getting an error during importation into PostGIS.
The GeoJSON's type is "FeatureCollection" and its name is "sql_statement". I can successfully import GeoJSONs with a few small features into PostGIS, so I know ogr2ogr is working properly.
I am trying:
ogr2ogr -f "PostgreSQL" PG:"dbname=ubuntu" "final_plantations.geojson" -nln plantations -progress
I expected it to import but received the following error:
ERROR 1: JSON parsing error: continue (at offset 1183876445) ERROR 4: Failed to read GeoJSON data FAILURE: Unable to open datasource 'final_plantations.geojson' with the following drivers. -> 'PCIDSK' -> 'netCDF' -> 'JP2OpenJPEG'
I assume this means there's a problem with a particular feature or that the GeoJSON is too large to import but I'm not sure. Please help me with importing this GeoJSON. Alternatively, if you have ideas about how to directly rasterize the GeoJSON, that'd be great, too. I tried using
gdal_rasterizebut received the same error as above, minus the failure to find a driver.
Batch convert multiple .GML files to postgis sql tables using ogr2ogr
I have a folder with 150 .gml files I need to upload to my postgis/postgres database. After the first gml is uploaded, the rest will be appended to it to form a single table. However I don't know how to make ogr2ogr iterate through each file... currently I'm having to upload/append each cml induvidually.
My code to convert the first gml:
ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password" -lco SCHEMA=test_schema "D:\path to folder\File1.gml" -progress -lco OVERWRITE=YES
and my code to append each subsequent gml to the first:
ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password active_schema=test_schema" "D:\path to folder\File2.gml" -progress
This works fine but I don't want to do this another 148 times, changing File2 to File3 each time etc...