[gdal-dev] GDAL C# Bindings: How to implement callback

2020-05-08 Thread rmaddu
Dear All,

I have called below GDAL function with callback, not getting the call to
callback function?

var newDs = Gdal.wrapper_GDALVectorTranslateDestName(output, ds,
gdalOptions, new Gdal.GDALProgressFuncDelegate(ProgressFunc), null);

 public static int ProgressFunc(double Complete, IntPtr Message, IntPtr
Data)
{

}

How to know that this call is complete?

Regards,
Rajesh



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] GDAL C# bindings, read from /vsimem/

2018-07-12 Thread Atle Frenvik Sveen
Hi list, first time poster here.


I'm using the GDAL C# bindings in .net core via the Gdal.Core Nuget package 
(https://www.nuget.org/packages/Gdal.Core/)

Everyting seems to work fine, apart from the fact that I have to touch the file 
system in order to get my created GeoTiff as a memory stream

Sample code:

var outputRasterFileName = $"{Path.GetTempPath()}{Guid.NewGuid()}.tiff";

var driver = Gdal.GetDriverByName("GTiff");
var ds = driver.Create(outputRasterFileName, resolution.X, resolution.Y, 1, 
DataType.GDT_Byte, null);

SetSrsFromLayer(ds, layer);
var arg = new[] { envelope.MinX, pixelSize, 0, envelope.MinY, 0, pixelSize };
ds.SetGeoTransform(arg);
var band = ds.GetRasterBand(1);
band.SetNoDataValue(noDataValue);
band.FlushCache();
var rasterizeOptions = new[] { "ALL_TOUCHED=TRUE" }; 

Gdal.RasterizeLayer(ds, 1, new[] { 1 }, layer, IntPtr.Zero, IntPtr.Zero, 1, 
new[] { 10.0 }, rasterizeOptions, null, null);
ds.FlushCache();

var destination = new MemoryStream();

using (var source = File.Open(outputRasterFileName, FileMode.Open))
{
source.CopyTo(destination);
destination.Position = 0;
return destination;
}

This works, but I do not like the idea of writing to disk when I don't have to. 
I then found these threads: 
http://osgeo-org.1560.x6.nabble.com/gdal-dev-NET-and-OGR-writing-to-stream-td3744067.html#a3744070
https://lists.osgeo.org/pipermail/gdal-dev/2016-August/045030.html

Which says I can use the memory file system handler, and the python sample code 
provided by Even seems easy enough to translate:

# Read /vsimem/output.png 
f = gdal.VSIFOpenL('/vsimem/output.png', 'rb')
gdal.VSIFSeekL(f, 0, 2) # seek to end
size = gdal.VSIFTellL(f)
gdal.VSIFSeekL(f, 0, 0) # seek to beginning
data = gdal.VSIFReadL(1, size, f)
gdal.VSIFCloseL(f)
# Cleanup
gdal.Unlink('/vsimem/output.png')


However, the C# bindings does not seem to include VSIFReadL, although Maksim 
Sestic seems to indicate that they are.

Is this an issue with the Nuget-package?

I then tried using C# Marshal.Copy, but this fails:

var bufPtr = Gdal.VSIFOpenL(outputRasterFileName, "rb"); 
//outputRasterFileName is now "/vsimem/file.tiff"
Gdal.VSIFSeekL(bufPtr, 0, 2); // seek to end
var size = Gdal.VSIFTellL(bufPtr);
Gdal.VSIFSeekL(bufPtr, 0, 0); // seek to beginning
Gdal.VSIFCloseL(bufPtr);
var data = new byte[size];
Marshal.Copy(bufPtr, data, 0, size);   
Gdal.Unlink(outputRasterFileName);   

I am by no means a C# expert, but I cannot see any reason this should fail? 
Given a memory pointer and size, read bytes, right?


As a last alternative I've tried to use the examples provided here: 
https://trac.osgeo.org/gdal/browser/trunk/gdal/swig/csharp/apps/GDALReadDirect.cs

This lets me read the bitmap of my raster, but all geotiff-metadata is lost. 
This also seems a bit overkill, as the actual GeoTiff is created and exists in 
memory!

So, to sum up a large mail:

1. Should Gdal.VSIFReadL be available in the C# bindings? If so, how do I get 
them?
2. If not 1, Should I be able to use Marshal.Copy in the manner described 
above? Or are there any other ways of getting these bytes?
3. If not 2, is using the sample code in 
https://trac.osgeo.org/gdal/browser/trunk/gdal/swig/csharp/apps/GDALReadDirect.cs
 a feasible way to create a stream of a geotiff-file`?


Thanks in advance for your replies, and thanks for a great library!

-a

-- 
  Atle Frenvik Sveen
  a...@frenviksveen.net
  45278689
  atlefren.net
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-25 Thread Jukka Rahkonen
ChiefDan ChiefDan at gmail.com writes:

 
 Jukka Rahkonen wrote
  Hi,
  
  Could you make a drawing about what you have and what you want to get?
  
  If your aim is to cut long linestrings only where they intersect with
  points
  from the point layer I believe that it is not easy with plain GDAL. There
  are some useful functions in the SQLite/Spatialite SQL dialect
  https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html, like
  LinesCutAtNodes and Snap if you lines are only close to vertex a a
  linestring. LinesCutAtNodes is making multilinestrings so you should
  continue with something like the -explodecollections option in ogr2ogr.
  
  -Jukka Rahkonen-
 
 --I'm thinking to have a network of point-line-points for path finding. Pick
 any one of the green points above, I need to create line segments from that
 point to any point in any direction on the line that point is on to the next
 point. In the end, the layers would visualize in the same manner, however
 the original line(s) would now have end points at those green points. 
 
 I'll look into Spatialite, I knew it had networking api as well.

Hi,

I did not mean that you should use Spatialite instead of GDAL but that you
can utilize all that is supported by spatialite with GDAL through the SQLite
SQL dialect http://www.gdal.org/ogr_sql_sqlite.html.

Thanks for the image which I saw by accident from the Nabble thread. It does
not appear in any way gmane which I usually use for reading the mails.

You seem to be interested in on which track trains are standing. How about
this plan:
Cut all the linestrings which present tracks to reasonably short segments.
Trains are long so perhaps segments could be about 200 meters or even
longer. You can do the densification with ogr2ogr -segmentize 200. Build the
routing graph based on this segmentized data.

When you start routing you could now
- Select the segment that is closest to your train
- Select the start point/end point of that segment to be used as
node_from/node_to for your routing algorithm.

Because segments can be 200 m long the selected start/end node can be nearly
200 meters away from the reference point but because trains and platforms
are so long that should not matter so much. After all, both the first and
last car in a train are following the same route.

-Jukka Rahkonen-


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-25 Thread Jukka Rahkonen
ChiefDan ChiefDan at gmail.com writes:

 
 Jukka,
 
 THanks for the suggestions. THe green points are the decision points, so I
 need to use those in my pathing. For instance, I would choose one of those
 points and then choose another green point as the destination to get the
 route(s).

I have not really done anything useful with routing so my thinking may be
all wrong. I was thinking that there is a green point A on top of segment P,
and another green point B on top of R and you want to go from A to B. If you
select the start point of P and end point of R and compute a route between
them, doesn't the route necessarily go also via A and B? Splitting the line
segments from the middle at exact locations of A and B would not make any
real change into the graph and routing because new nodes would be only
pass-through nodes with cardinality of 2.

-Jukka Rahkonen-



___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-25 Thread ChiefDan
Jukka,

THanks for the suggestions. THe green points are the decision points, so I
need to use those in my pathing. For instance, I would choose one of those
points and then choose another green point as the destination to get the
route(s).



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195426.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-25 Thread ChiefDan
Jukka,

I've not done anything useful with routing either, so I'm sure once I solve
my issue, I'll immediately realize a simpler way to do it.
Your segmenting the lines has given me an idea that is similar: Add the
points into the linestrings.
I think if I do this I can then more easily create line segments with the
start/end points at my green points.
Given a point, I can then determine which line it is on. Once I have that
line, I can loop through the points that make up that line until I find my
first point of interest. From that point in the line string I can then
iterate to the next point in the linestring, then search for that point in
my points layer. If I find it, that's a line segment.

THe complication will then be finding the next green point on an
intersecting linestring.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195438.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread ChiefDan
Jukka Rahkonen wrote
 Hi,
 
 Could you make a drawing about what you have and what you want to get?
 
 If your aim is to cut long linestrings only where they intersect with
 points
 from the point layer I believe that it is not easy with plain GDAL. There
 are some useful functions in the SQLite/Spatialite SQL dialect
 https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html, like
 LinesCutAtNodes and Snap if you lines are only close to vertex a a
 linestring. LinesCutAtNodes is making multilinestrings so you should
 continue with something like the -explodecollections option in ogr2ogr.
 
 -Jukka Rahkonen-

--I'm thinking to have a network of point-line-points for path finding. Pick
any one of the green points above, I need to create line segments from that
point to any point in any direction on the line that point is on to the next
point. In the end, the layers would visualize in the same manner, however
the original line(s) would now have end points at those green points. 

I'll look into Spatialite, I knew it had networking api as well.

Dan




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195274.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread ChiefDan
Matt Hanson-2 wrote
 So you've got a series of points in your point layer, and a series of
 lines
 in your line layer, and for each point on your points layer, you want to
 find out which line this falls on.

--I'm able to do this already.


Matt Hanson-2 wrote
 Is that right?  It sounds like you've done this part.  However, I'm not
 sure what is meant.  Is there an exact matching point on the line (i.e.
 same exact coordinates), or are you finding the line that the point falls
 on (using some sort of buffer or tolerance)?

--If you look at the picture above, those points are on the lines, but there
is not necessarily a corresponding point in the linestring, most likely
there is not.


Matt Hanson-2 wrote
 If you are just finding the line that it happens to fall on, (I think this
 is what you meant by not end points), then are you finding the closest
 point that actually is part of the line?

--I'm thinking to have a network of point-line-points for path finding. Pick
any one of the green points above, I need to create line segments from that
point to any point in any direction on the line that point is on to the next
point. In the end, the layers would visualize in the same manner, however
the original line(s) would now have end points at those green points.


Matt Hanson-2 wrote
 If you have found the closest point on the line, then from there I think
 it's easy to walk up and down the line by retrieving the points in order.
 However, if you currently only have the linestring and the point
 coordinates then use distance to find the actual closest on-line point.
 
 
 Do I have this mostly right or have I only managed to confuse things more?

--I'm sure I am not explaining it well as this is my first foray into path
finding and preparing the data so far has been the most difficult part. I'm
not fluent in GIS either so I think I'm lacking in proper vocabulary.




--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195273.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread Matt Hanson
ChiefDan,

If I understand the problem correctly...

If you get the OGRGeometry of your line string (get the WKT from that or
somehow turn into an array or list that is easy to work with) you will have
all the points in order along the line.  Then, you'll need to find your
initial point of interest.  Once you find that match you can traverse up or
down the array.

matt



On Tue, Mar 24, 2015 at 5:09 AM, ChiefDan chief...@gmail.com wrote:

 Yes, I've experimented with that library and actually asked a follow up
 question here about it. To properly use it, I need to prepare the layer in
 the manner I am asking about.



 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195113.html
 Sent from the GDAL - Dev mailing list archive at Nabble.com.
 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread ChiefDan
Yes, I've experimented with that library and actually asked a follow up
question here about it. To properly use it, I need to prepare the layer in
the manner I am asking about.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195113.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread Matt Hanson
Want to make sure I understand this properly.

So you've got a series of points in your point layer, and a series of lines
in your line layer, and for each point on your points layer, you want to
find out which line this falls on.

Is that right?  It sounds like you've done this part.  However, I'm not
sure what is meant.  Is there an exact matching point on the line (i.e.
same exact coordinates), or are you finding the line that the point falls
on (using some sort of buffer or tolerance)?

If you are just finding the line that it happens to fall on, (I think this
is what you meant by not end points), then are you finding the closest
point that actually is part of the line?

If you have found the closest point on the line, then from there I think
it's easy to walk up and down the line by retrieving the points in order.
However, if you currently only have the linestring and the point
coordinates then use distance to find the actual closest on-line point.


Do I have this mostly right or have I only managed to confuse things more?




On Tue, Mar 24, 2015 at 2:11 PM, ChiefDan chief...@gmail.com wrote:

 Matt,

 I've got a line layer and a points layer. The points layer fall on the line
 layer, however they are not end points on the line layer, for the most
 part.

 I'm not sure if that answers your question or not.



 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195238.html
 Sent from the GDAL - Dev mailing list archive at Nabble.com.
 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread Jukka Rahkonen
ChiefDan ChiefDan at gmail.com writes:

 
 Matt,
 
 I've got a line layer and a points layer. The points layer fall on the line
 layer, however they are not end points on the line layer, for the most part.
 
 I'm not sure if that answers your question or not.

Hi,

Could you make a drawing about what you have and what you want to get?

If your aim is to cut long linestrings only where they intersect with points
from the point layer I believe that it is not easy with plain GDAL. There
are some useful functions in the SQLite/Spatialite SQL dialect
https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html, like
LinesCutAtNodes and Snap if you lines are only close to vertex a a
linestring. LinesCutAtNodes is making multilinestrings so you should
continue with something like the -explodecollections option in ogr2ogr.

-Jukka Rahkonen-

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-24 Thread ChiefDan
Matt,

I've got a line layer and a points layer. The points layer fall on the line
layer, however they are not end points on the line layer, for the most part.

I'm not sure if that answers your question or not.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195238.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-23 Thread ChiefDan
I am trying to create a pathfinding graph from a shapefile with a line layer
and point layer. 

Using the C++ API, for each point in the points layer, I need to find the
next N points that are connected to that point along one or more
OGRLineStrings. I've been able to determine which OGRLineString in the
OGRMultiLineString a point from the points layer is on. I'd be creating new
line segments with these neighboring points as the start/end point and this
would be the path pair for the pathing as well.

I am not sure how to determine what point(s) from the points layer are next
on the line. Using the Distance() to compare won't work since a point could
be within the radius, but not on a line that would directly connect the 2
points.

I appreciate any pointers.


Dan



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C++ Api, create new line segments from point layer

2015-03-23 Thread ChiefDan
Would GEOS be a more appropriate library to use? GDAL was my goto due to
familiarity.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/GDAL-C-Api-create-new-line-segments-from-point-layer-tp5195061p5195070.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C# bindings - using rasterlite and spatialite in the same database

2014-02-27 Thread Even Rouault
Le mardi 25 février 2014 18:12:55, Marcel Gangwisch a écrit :
 Hi *,
 
 I use the following command:
 
 rasterliteDriver.CreateCopy(RASTERLITE:GeoDatabase.db,TABLE=raster_test,
 source, 1, options, null, null);
 
 to read every gdal raster in my rasterlite database. After reading I'm
 also able to read another raster of vector file into the sqlite
 database. Everything works fine.
 
 My Problem is now if I do this the other way around:
 Then I first read a vector file into a spatialite database, and after
 that I want to read a raster file into the same database I get the
 following exception:
 does not exist in the file system, and is not recognised as a supported
 dataset name
 
 Does anybody know what I'm doing wrong?

Marcel,

You should provide something more precise to reproduce. I've tested 
successfully the equivalent operations of what I've understood of your above 
description with the following command lines :

ogr2ogr -f sqlite poly.sqlite poly.shp -dsco spatialite=yes
gdal_translate -of rasterlite byte.tif RASTERLITE:poly.sqlite,TABLE=byte

and then both ogrinfo and gdalinfo show the vector and raster layers.

Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C# bindings - using rasterlite and spatialite in the same database

2014-02-27 Thread Marcel Gangwisch

Dear Even,

thank you for your answer! I think I know the real problem now.
Respectively Sandro (I think a developer of rasterlite) gave me the 
correct hint.
(https://groups.google.com/forum/?hl=de#!topic/spatialite-users/g8b3va_zteg 
https://groups.google.com/forum/?hl=de#%21topic/spatialite-users/g8b3va_zteg)


For the generation of the spatialite database I used spatialite 4.0...
But the precompiled gdal version (http://vbkto.dyndns.org:1280/sdk/) I 
used, uses spatialite 3.0...

I checked that, with the spatialite-gui.

So like Sandro wrote:
/in this case a new style DB-file will be created in the first step; //
//but librasterlite hasn't the capability to access new style DB-files, //
//so any further attempt to import some raster data will then fail. /

The Question is now, what to do...
Obviously I want to use the newest spatialite version.
Therefore I thinking about building gdal against spatialite 4.
On the other side, Sandro wrote, that rasterlite 2 will be coming soon.
So maybe I just stay on spatialite version 3. And use later version 4.

Best regards,
Marcel

Am 27.02.2014 20:23, schrieb Even Rouault:

Le mardi 25 février 2014 18:12:55, Marcel Gangwisch a écrit :

Hi *,

I use the following command:

rasterliteDriver.CreateCopy(RASTERLITE:GeoDatabase.db,TABLE=raster_test,
source, 1, options, null, null);

to read every gdal raster in my rasterlite database. After reading I'm
also able to read another raster of vector file into the sqlite
database. Everything works fine.

My Problem is now if I do this the other way around:
Then I first read a vector file into a spatialite database, and after
that I want to read a raster file into the same database I get the
following exception:
does not exist in the file system, and is not recognised as a supported
dataset name

Does anybody know what I'm doing wrong?

Marcel,

You should provide something more precise to reproduce. I've tested
successfully the equivalent operations of what I've understood of your above
description with the following command lines :

ogr2ogr -f sqlite poly.sqlite poly.shp -dsco spatialite=yes
gdal_translate -of rasterlite byte.tif RASTERLITE:poly.sqlite,TABLE=byte

and then both ogrinfo and gdalinfo show the vector and raster layers.

Even



___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] GDAL C# bindings - using rasterlite and spatialite in the same database

2014-02-27 Thread Even Rouault
Le jeudi 27 février 2014 21:39:52, Marcel Gangwisch a écrit :
 Dear Even,
 
 thank you for your answer! I think I know the real problem now.
 Respectively Sandro (I think a developer of rasterlite) gave me the
 correct hint.
 (https://groups.google.com/forum/?hl=de#!topic/spatialite-users/g8b3va_zteg
 https://groups.google.com/forum/?hl=de#%21topic/spatialite-users/g8b3va_zt
 eg)
 
 For the generation of the spatialite database I used spatialite 4.0...
 But the precompiled gdal version (http://vbkto.dyndns.org:1280/sdk/) I
 used, uses spatialite 3.0...
 I checked that, with the spatialite-gui.

I doubt this is the reason. GDAL doesn't use librasterlite code. So when you 
stay with GDAL/OGR utilities, that should work. Of course the problem is that 
rasterlite DBs produced by GDAL may not work correctly with spatialite 
utilities.

 
 So like Sandro wrote:
 /in this case a new style DB-file will be created in the first step; //
 //but librasterlite hasn't the capability to access new style DB-files,
 // //so any further attempt to import some raster data will then fail. /
 
 The Question is now, what to do...
 Obviously I want to use the newest spatialite version.
 Therefore I thinking about building gdal against spatialite 4.
 On the other side, Sandro wrote, that rasterlite 2 will be coming soon.
 So maybe I just stay on spatialite version 3. And use later version 4.
 
 Best regards,
 Marcel
 
 Am 27.02.2014 20:23, schrieb Even Rouault:
  Le mardi 25 février 2014 18:12:55, Marcel Gangwisch a écrit :
  Hi *,
  
  I use the following command:
  
  rasterliteDriver.CreateCopy(RASTERLITE:GeoDatabase.db,TABLE=raster_test
  , source, 1, options, null, null);
  
  to read every gdal raster in my rasterlite database. After reading I'm
  also able to read another raster of vector file into the sqlite
  database. Everything works fine.
  
  My Problem is now if I do this the other way around:
  Then I first read a vector file into a spatialite database, and after
  that I want to read a raster file into the same database I get the
  following exception:
  does not exist in the file system, and is not recognised as a supported
  dataset name
  
  Does anybody know what I'm doing wrong?
  
  Marcel,
  
  You should provide something more precise to reproduce. I've tested
  successfully the equivalent operations of what I've understood of your
  above description with the following command lines :
  
  ogr2ogr -f sqlite poly.sqlite poly.shp -dsco spatialite=yes
  gdal_translate -of rasterlite byte.tif RASTERLITE:poly.sqlite,TABLE=byte
  
  and then both ogrinfo and gdalinfo show the vector and raster layers.
  
  Even

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] GDAL C# bindings - using rasterlite and spatialite in the same database

2014-02-25 Thread Marcel Gangwisch

Hi *,

I use the following command:

rasterliteDriver.CreateCopy(RASTERLITE:GeoDatabase.db,TABLE=raster_test, 
source, 1, options, null, null);


to read every gdal raster in my rasterlite database. After reading I'm 
also able to read another raster of vector file into the sqlite 
database. Everything works fine.


My Problem is now if I do this the other way around:
Then I first read a vector file into a spatialite database, and after 
that I want to read a raster file into the same database I get the 
following exception:
does not exist in the file system, and is not recognised as a supported 
dataset name


Does anybody know what I'm doing wrong?


Best regards,

Marcel
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] GDAL C# bindings using rasterlite

2014-02-24 Thread Marcel Gangwisch

Hi *,

currently I'm using SQLite + Spatialite + GDAL to manage vector data.
I know it is also possible to use SQLite also with raster data. 
Therefore I have to translate all GDAL input data to

sqlite as rasterlite.

Does anybody know how to do that, with the help of the GDAL C# bindings?

- Have a nice day, Marcel
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C# bindings using rasterlite

2014-02-24 Thread Even Rouault
Le lundi 24 février 2014 09:35:42, Marcel Gangwisch a écrit :
 Hi *,
 
 currently I'm using SQLite + Spatialite + GDAL to manage vector data.
 I know it is also possible to use SQLite also with raster data.
 Therefore I have to translate all GDAL input data to
 sqlite as rasterlite.
 
 Does anybody know how to do that, with the help of the GDAL C# bindings?

you should be able to do that with the CreateCopy() method of the Rasterlite 
driver.

 
 - Have a nice day, Marcel
 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] Gdal C# Async Read

2012-12-06 Thread netcadturgay
Is there any solution for reading a file with multi-thread access? Also every
thread will read a different area.



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/Gdal-C-Async-Read-tp5021363.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


[gdal-dev] gdal + C#

2012-09-06 Thread Neelima Emmani
Hi Chaitanya  All,
In my GDAL1.9 version, I have a swig folder. And according to the below link
http://trac.osgeo.org/gdal/wiki/GdalOgrCsharpCompile#Compilingthecode
It says, that i need to download swigwin-1.3.31 package. My question is do i 
need to overwrite the existing swig folder with this downloaded  swigwin-1.3.31.
Awaiting reply.

With Regards,
Neelima Emmani

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] gdal + C#

2012-09-05 Thread Neelima Emmani
Hi All,

Actually i want to access gespatial data using GDAL into C#. For this I tried 
to add gdal reference to C#. I took gdal1.9 download from gdal website. Inwhich 
i found gdai19.dll . And then tried to add this as a reference to c# . But 
unfortunately, C# is popping me up with an error msg.
Does anyone know how to read geospatial data into c#.
Awaiting reply.
With Regards,
Neelima Emmani
GIS Developer

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdal + C#

2012-09-05 Thread Chaitanya kumar CH
Neelima,

Please go through the documentation in the website.
http://trac.osgeo.org/gdal/wiki/GdalOgrInCsharp

On Thu, Sep 6, 2012 at 10:31 AM, Neelima Emmani 
neelima.emm...@iictechnologies.com wrote:

  Hi All,

 Actually i want to access gespatial data using GDAL into C#. For this I
 tried to add gdal reference to C#. I took gdal1.9 download from gdal
 website. Inwhich i found gdai19.dll . And then tried to add this as a
 reference to c# . But unfortunately, C# is popping me up with an error msg.
 Does anyone know how to read geospatial data into c#.
 Awaiting reply.
 With Regards,
 Neelima Emmani
 GIS Developer


 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev




-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] gdal + C#

2012-09-05 Thread Chaitanya kumar CH
Neelima,

GDAL's C# interface binaries are not maintained well. So it is better to
compile to get the latest version.

If you are going to use the dlls available elsewhere, make sure you have
them all.
http://trac.osgeo.org/gdal/wiki/GdalOgrCsharpCompile#Compilingthecode shows
a list of those files.

On Thu, Sep 6, 2012 at 10:56 AM, Neelima Emmani 
neelima.emm...@iictechnologies.com wrote:

  Hi Chaitanya,
 Yeah, i went through the document and tried to compile gdal . And  gives
 me a nmake fatal error:1077 that it is not able to find swig.exe.Yes, in my
 folder of swig which is under gdal  doesnot consist of swig.exe, so, do i
 need to download it from external source. If so, even tried the same. But
 no result.

 My questions -

- Do i need to really compile the gdal-1.9.1
- Can i use few dll's that are available on net like gdal_csharp,
ogr_csharp, osr_csharp. But unfortunately, this option also did not work
for me. Here, the C# accepted dlls. But popping up an error, when i ask it
to ogr.registerall() or when i use any other gdal inbuilt functionalities.

 awaiting reply.
  With Regards,
 Neelima Emmani
 GIS Developer
   --
 *From:* Chaitanya kumar CH [chaitanya...@gmail.com]
 *Sent:* Thursday, September 06, 2012 10:31 AM
 *To:* Neelima Emmani
 *Cc:* gdal-dev@lists.osgeo.org
 *Subject:* Re: [gdal-dev] gdal + C#

  Neelima,

 Please go through the documentation in the website.
 http://trac.osgeo.org/gdal/wiki/GdalOgrInCsharp

 On Thu, Sep 6, 2012 at 10:31 AM, Neelima Emmani 
 neelima.emm...@iictechnologies.com wrote:

  Hi All,

 Actually i want to access gespatial data using GDAL into C#. For this I
 tried to add gdal reference to C#. I took gdal1.9 download from gdal
 website. Inwhich i found gdai19.dll . And then tried to add this as a
 reference to c# . But unfortunately, C# is popping me up with an error msg.
 Does anyone know how to read geospatial data into c#.
 Awaiting reply.
 With Regards,
 Neelima Emmani
 GIS Developer


 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev





-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

[gdal-dev] GDAL/C++ Cut out and possibly reproject a sub-image

2012-04-15 Thread tseval
Hi folks,

I am programming an application where I want to produce small tiles in a
given projection from a lot of input image files. The input files may be
different projections and resolutions. 

I have read the API tutorials and looked through the GDAL documentation, and
searched this mailing list, but I'm still a bit uncertain as to how I should
implement this. Hopefully someone can give me a few pointers to get started
:-)

I suppose I should use the Warp API to do the actual reprojection and
cutting of the images. And I think I should use a VRT dataset to represent
all the input images?

If I understand correctly, a VRT dataset is a virtual dataset that
represents several input files. I have however not figured out how to
programatically add input files to my dataset? I was looking for something
along the lines of an AddFile() method, but couldn't find any?

Am I wrong in assuming that a VRT is the best way to represent my input
data?

Can I have a target GDALDataset that exists only in memory? I do not need to
store the output image on disk , and it will always be quite small
(typically 256x256 pixels), so I can not see any reason that it needs to be
stored for of out of memory operations either.

Also, I can't exactly see how I should set up the WarpOperation to reproject
and cut only a sub-image of the large VRT dataset?

Any help on this would be greatly appreciated!

Cheers,
Thomas

--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/GDAL-C-Cut-out-and-possibly-reproject-a-sub-image-tp4883738p4883738.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: [gdal-dev] GDAL C# interface

2009-11-13 Thread Tamas Szekeres
Hi,

You could try one of the packages available from here for example:
http://vbkto.dyndns.org/sdk/

Best regards,

Tamas


2009/11/13  yanb...@cma.gov.cn:
 Dear All,



 Who have GDAL binary DLL libs for C#? I download the source code and did not
 successes to compile them for C# interface.







 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Re: 答复: [gdal-dev] GDAL C# interface

2009-11-13 Thread Tamas Szekeres
Probaly FWTools or osgeo4w would support hdf4 packages.

Best regards,

Tamas



2009/11/13  yanb...@cma.gov.cn:
 Dear Tamas,

 Thanks for your reply and I checked the URLS in your email. Yes there are
 some binary packages supporting C#. But I checked the supporting raster
 formats, I found the one I will to use, HDF4 format is not included. Is
 there any ideas or good suggestions?

 Thanks a lot

 Yanbo

 -邮件原件-
 发件人: Tamas Szekeres [mailto:szeker...@gmail.com]
 发送时间: 2009年11月13日 23:11
 收件人: yanb...@cma.gov.cn
 抄送: gdal-dev@lists.osgeo.org
 主题: Re: [gdal-dev] GDAL C# interface

 Hi,

 You could try one of the packages available from here for example:
 http://vbkto.dyndns.org/sdk/

 Best regards,

 Tamas


 2009/11/13  yanb...@cma.gov.cn:
 Dear All,



 Who have GDAL binary DLL libs for C#? I download the source code and did
 not
 successes to compile them for C# interface.







 ___
 gdal-dev mailing list
 gdal-dev@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/gdal-dev



___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev