ASCII and Shapefile

P Kishor punkish at EIDESIS.ORG
Fri Sep 8 08:33:05 PDT 2006


On 9/8/06, Ryan Ollerenshaw <ollerery at engr.orst.edu> wrote:
>
> P Kishor wrote:
> > ogr2ogr
> >
> Looks like ogr2ogr needs a specific format.

Unfortunately, making ogr2ogr work has been a pain in the behind for
me. Search for a recent thread on this subject started by me. Frank W.
answered with a bunch of clarifications that might help. Here are a
few of them

>
>  > ogr2ogr -f "ESRI Shapefile" -a_srs epsg:4326 output thick08.csv
> FAILURE:
> Unable to open datasource `thick08.ps' with the following drivers.

You mention 'thick08.csv' in your first line above, and then write
'thick08.ps' two lines below that. Either one or the other is a typo,
no?
..
> My file just looks like this:
>       0.00     90.00     -1.41      6.12
>       1.00     90.00     -1.41      6.12
>       2.00     90.00     -1.41      6.12
>       3.00     90.00     -1.41      6.12
>       4.00     90.00     -1.41      6.12
>       5.00     90.00     -1.41      6.12

Unfortunately, the above file is not a csv, and just calling it so
would not make it so. A csv file is a "comma separated variable" file,
and what you are showing above seems like a fixed-width format.
Additionally, you can't just specify a csv file on the command line
like that. You actually have to specify the csv file inside an ovf
file (think of it as datasource definition), and then specify the ovf
file on the command-line. Did I say it is a pain in the behind?

Go to the mapserver website and search for "virtual driver" or
"ogr2ogr". There are some instructions there.

I am doing more experimenting with my own data, and once I am clear as
mud, I will add/post more clear and step-by-step instructions on this.
Your experience also will help in adding to this, and eventually we
can take it to FrankW. and help him improve user-experience with
ogr2ogr. It is definitely a very important tool/step in
dataprocessing, and it should be made easy to understand and use
instead of having to use proprietary software just to accomplish this.



> Any help would be great
> > On 9/7/06, Ryan Ollerenshaw <ollerery at engr.orst.edu> wrote:
> >> Is there a way to go from an ASCII file to a Shapefile?  I have a file
> >> that contains a list of lat/long coordinates and there values at each
> >> point,  and i know what the projection will, be so is there a way to
> >> create a shapefile from and ASCII file if the projection is known?
> >>
> >>
> >
> >
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/



More information about the MapServer-users mailing list