|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Adding new shape to shapefileHello,
First, sorry for my English, I’ll promise you I’ll do my best. I’m in a training period in order to prepare my degree and I’ve in charge of the development of a PPC application in C# using shapelib. I read some posts in this forum about adding shapes in shapefile, and I apply some parts of code in my application but, I have a problem with the SHPWriteObject function. The application runs correctly but nothing is written in my shapefile. Someone could help me ? Do I make a mistake in my code ? Well thank you for your help Romain My code : IntPtr newShp = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\ARRETBUS.shp", ShapeFile.ShapeFile.ShapeType.Point); double[] dblX = new double[1]; dblX[0] = 803606; double[] dblY = new double[1]; dblY[0] = 800000; IntPtr newDbf = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\ARRETBUS.dbf"); IntPtr pso = shpFile.SHPCreateObject(ShapeFile.ShapeFile.ShapeType.Point, 1, 1, null, null, 1, dblX, dblY, null, null); IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, dblX, dblY, null); shpFile.SHPWriteObject(newShp, -1, psObject); shpFile.SHPWriteObject(newShp, -1, pso); shpFile.DBFClose(newDbf); shpFile.SHPClose(newShp); |
|
|
RE: Adding new shape to shapefileIf it works like in Delphi, after creating the file you should close it with
shpFile.SHPClose(newShp); and then reopen it with IntPtr newShp = shpFile.SHPOpen(@"\SD-MMCard\TestParcelle\ARRETBUS.shp ", "rb+") to insure appending mode. I believe the same goes for the dbf file. Let me know if it helped. -----Original Message----- From: shapelib-bounces@... [mailto:shapelib-bounces@...] On Behalf Of thecrashteam Sent: Thursday, May 29, 2008 6:31 PM To: shapelib@... Subject: [Shapelib] Adding new shape to shapefile Hello, First, sorry for my English, I'll promise you I'll do my best. I'm in a training period in order to prepare my degree and I've in charge of the development of a PPC application in C# using shapelib. I read some posts in this forum about adding shapes in shapefile, and I apply some parts of code in my application but, I have a problem with the SHPWriteObject function. The application runs correctly but nothing is written in my shapefile. Someone could help me ? Do I make a mistake in my code ? Well thank you for your help Romain My code : IntPtr newShp = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\ARRETBUS.shp", ShapeFile.ShapeFile.ShapeType.Point); double[] dblX = new double[1]; dblX[0] = 803606; double[] dblY = new double[1]; dblY[0] = 800000; IntPtr newDbf = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\ARRETBUS.dbf"); IntPtr pso = shpFile.SHPCreateObject(ShapeFile.ShapeFile.ShapeType.Point, 1, 1, null, null, 1, dblX, dblY, null, null); IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, dblX, dblY, null); shpFile.SHPWriteObject(newShp, -1, psObject); shpFile.SHPWriteObject(newShp, -1, pso); shpFile.DBFClose(newDbf); shpFile.SHPClose(newShp); -- View this message in context: http://www.nabble.com/Adding-new-shape-to-shapefile-tp17536792p17536792.html Sent from the ShapeLib mailing list archive at Nabble.com. _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileI'm sorry, that doesn't work anymore...
My file is not even created !
Thank you for your quick reply 2008/5/29 Vassilis Perantzakis <vaspervnp@...>: If it works like in Delphi, after creating the file you should close it with _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
RE: Adding new shape to shapefileHi, Did you use first the shpcreate
as you do now and then the shpopen (this is correct)? Or did you replace the shpcreate
with the shpopen (this is false) From:
shapelib-bounces@...
[mailto:shapelib-bounces@...] On
Behalf Of romain didier I'm sorry, that doesn't work anymore... My file is not even created ! Thank you for your quick reply 2008/5/29 Vassilis Perantzakis <vaspervnp@...>: If it works like in Delphi, after creating the file you should close it
with _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileHi,
I use the shpCreate before and then the shpOpen. I don't know why it doesn't work...
2008/5/29 Vassilis Perantzakis <vaspervnp@...>:
_______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefilehi,
I post my new code. It doesn't function but there is no error. My shapeFile and its dbf file are not created. Someone could say to me why it doesn't work please ? Thank you for your help Romain IntPtr ptrCreateSHP = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test.shp", ShapeFile.ShapeFile.ShapeType.Point); shpFile.SHPClose(ptrCreateSHP); IntPtr ptrCreateDBF = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test.dbf"); shpFile.DBFClose(ptrCreateDBF); IntPtr ptrOpenDBF = shpFile.DBFOpen(@"\SD-MMCard\TestParcelle\test.dbf", "rb+"); IntPtr ptrOpenSHP = shpFile.SHPOpen(@"\SD-MMCard\TestParcelle\test.shp", "rb+"); double[] x = new double[1]; double[] y = new double[1]; double[] z = new double[1]; x[0] = 803606; y[0] = 803606; z[0] = 0; IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, z); shpFile.SHPWriteObject(ptrOpenSHP, -1, psObject); shpFile.SHPDestroyObject(psObject); shpFile.DBFWriteDoubleAttribute(ptrOpenDBF, -1, 0, 0d); shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 1, "toto"); shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 2, "aime"); shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 3, "les"); shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 4, "fraises"); shpFile.DBFClose(ptrOpenDBF); |
|
|
Re: Adding new shape to shapefileAnyone could help me please ?
I don't know what to do and I don't progress in my work... ![]() |
|
|
Re: Adding new shape to shapefileHi Romain,
- First, creating-closing-opening probably should not be necessary. I believe you're just fine if you only do the create step. - I see you don't close the shapefile after writing. Not sure if this is relevant in this case as I see this isn't plain C, so there might be an automatic close I'm not aware of. - Before writing data to a DBF, you first must create the fields (see DBFAddField) - you should not use -1 as record number for a DBF file. This is just fine with adding objects to the shapefile to indicate you want to append it to the end, but the DBF API does not understand this. It just returns false as error code (check your error codes!). Always make sure the record number is between 0 and DBFGetRecordCount, 0 and DBFGetRecordCount included. When index is DBFGetRecordCount, it will append a new record (but only while writing of course, don't do that for reading). Hope this helps, Bram thecrashteam wrote: > hi, > > I post my new code. It doesn't function but there is no error. My shapeFile > and its dbf file are not created. Someone could say to me why it doesn't > work please ? > > Thank you for your help > > Romain > > > > > IntPtr ptrCreateSHP = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test.shp", > ShapeFile.ShapeFile.ShapeType.Point); > shpFile.SHPClose(ptrCreateSHP); > > IntPtr ptrCreateDBF = > shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test.dbf"); > shpFile.DBFClose(ptrCreateDBF); > > IntPtr ptrOpenDBF = shpFile.DBFOpen(@"\SD-MMCard\TestParcelle\test.dbf", > "rb+"); > > IntPtr ptrOpenSHP = shpFile.SHPOpen(@"\SD-MMCard\TestParcelle\test.shp", > "rb+"); > > double[] x = new double[1]; > double[] y = new double[1]; > double[] z = new double[1]; > x[0] = 803606; > y[0] = 803606; > z[0] = 0; > > IntPtr psObject = > shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, > z); > > shpFile.SHPWriteObject(ptrOpenSHP, -1, psObject); > shpFile.SHPDestroyObject(psObject); > > shpFile.DBFWriteDoubleAttribute(ptrOpenDBF, -1, 0, 0d); > shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 1, "toto"); > shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 2, "aime"); > shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 3, "les"); > shpFile.DBFWriteStringAttribute(ptrOpenDBF, -1, 4, "fraises"); > > shpFile.DBFClose(ptrOpenDBF); > > Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileHi Bram,
I've tested what you told me but it still not work. I have no error, but my dbf and my shp are not created. I post my new code, so could you tell me if I do (again ^^) something wrong ? Thank you Romain. My code : //création du dbf IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test.dbf"); //création du shapefile IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test.shp", ShapeFile.ShapeFile.ShapeType.Point); //nouvelle colonne dans le dbf shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test.dbf", ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); //écriture de la valeur liée au futur shape shpFile.DBFWriteStringAttribute(ptrDBFCreate, shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); //création du point double[] x = new double[1]; double[] y = new double[1]; double[] z = new double[1]; x[0] = 803606; y[0] = 803606; z[0] = 0; IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, z); //écriture du point dans le shape shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); //fermeture du dbf et du shapefile shpFile.SHPClose(ptrSHPCreate); shpFile.DBFClose(ptrDBFCreate); |
|
|
RE: Adding new shape to shapefileHi,
First try not using the extensions. It is possible that the .shx file is not created. So instead of: IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test.shp", ShapeFile.ShapeFile.ShapeType.Point) Try: IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test", ShapeFile.ShapeFile.ShapeType.Point) The same I think goes for dbf file. -----Original Message----- From: shapelib-bounces@... [mailto:shapelib-bounces@...] On Behalf Of thecrashteam Sent: Wednesday, June 04, 2008 11:04 AM To: shapelib@... Subject: Re: [Shapelib] Adding new shape to shapefile Hi Bram, I've tested what you told me but it still not work. I have no error, but my dbf and my shp are not created. I post my new code, so could you tell me if I do (again ^^) something wrong ? Thank you Romain. My code : //création du dbf IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test.dbf"); //création du shapefile IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test.shp", ShapeFile.ShapeFile.ShapeType.Point); //nouvelle colonne dans le dbf shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test.dbf", ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); //écriture de la valeur liée au futur shape shpFile.DBFWriteStringAttribute(ptrDBFCreate, shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); //création du point double[] x = new double[1]; double[] y = new double[1]; double[] z = new double[1]; x[0] = 803606; y[0] = 803606; z[0] = 0; IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, z); //écriture du point dans le shape shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); //fermeture du dbf et du shapefile shpFile.SHPClose(ptrSHPCreate); shpFile.DBFClose(ptrDBFCreate); -- View this message in context: http://www.nabble.com/Adding-new-shape-to-shapefile-tp17536792p17641274.html Sent from the ShapeLib mailing list archive at Nabble.com. _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
RE: Adding new shape to shapefileHi Vassilis,
I tried what you told me too, but it still not work. No error, but no files... It's hopeless !! ^^ I think there is something wrong against me with this library !!! Thank you for your reply ! Romain My code : //création du dbf IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test"); //création du shapefile IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test", ShapeFile.ShapeFile.ShapeType.Point); //nouvelle colonne dans le dbf shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test", ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); //écriture de la valeur liée au futur shape shpFile.DBFWriteStringAttribute(ptrDBFCreate, shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); //création du point double[] x = new double[1]; double[] y = new double[1]; double[] z = new double[1]; x[0] = 803606; y[0] = 803606; z[0] = 0; IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, z); //écriture du point dans le shape shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); //fermeture du dbf et du shapefile shpFile.SHPClose(ptrSHPCreate); shpFile.DBFClose(ptrDBFCreate); |
|
|
Re: Adding new shape to shapefileThe extension has nothing to do with it. At worst, it would create
something like test.shp.shp. As no files AT ALL are created, the problem probably is within DBFCreate and SHPCreate, as they should create file files straight away, even without the data being added. Please, check the return values of DBFCreate and SHPCreate. Are they null? Probably they are, and that means the creation of the files simply fail. And thus everything else fails too. Try a more simple filename like just "test". Are you prepared to step through the code in a debug session. Maybe you can figure out what exactly fails ... Good luck =) Bram thecrashteam schreef: > Hi Vassilis, > > > I tried what you told me too, but it still not work. No error, but no > files... It's hopeless !! ^^ > I think there is something wrong against me with this library !!! > > Thank you for your reply ! > > Romain > > My code : > > //création du dbf > IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test"); > > //création du shapefile > IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test", > ShapeFile.ShapeFile.ShapeType.Point); > > //nouvelle colonne dans le dbf > shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test", > ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); > > //écriture de la valeur liée au futur shape > shpFile.DBFWriteStringAttribute(ptrDBFCreate, > shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); > > //création du point > double[] x = new double[1]; > double[] y = new double[1]; > double[] z = new double[1]; > x[0] = 803606; > y[0] = 803606; > z[0] = 0; > > IntPtr psObject = > shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, > z); > > //écriture du point dans le shape > shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); > > //fermeture du dbf et du shapefile > shpFile.SHPClose(ptrSHPCreate); > shpFile.DBFClose(ptrDBFCreate); > _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileThank you for your help Bram, it is very nice !
So, I did a list of return values of functions used in my code : DBFCreate returns 375328, SHPCreate = 379776, DBFAddField = 0, DBFWriteStringAttribute = 1, SHPCreateSimpleObject = 410704, SHPWriteObject = 0. I hope you could tell me what these figures mean... And do you know where could I find documentation about shapelib ? Thank you again for your help Romain.
|
|
|
Re: Adding new shape to shapefileI didn't entirely follow this thread. I recognize that you seem to try to create the file on a memory card, hence the path "@\SD-MMCard\...". Did you - for testing - try to create the file on a local hard drive? Best regards,
Christian Directmedia Publishing GmbH · Möckernstraße 68 · 10965 Berlin www.digitale-bibliothek.de AG Berlin-Charlottenburg · HR B 58002 · USt.Id. DE173211737 Geschäftsführer: Ralf Szymanski · Erwin Jurschitza thecrashteam schrieb: Hi Vassilis, I tried what you told me too, but it still not work. No error, but no files... It's hopeless !! ^^ I think there is something wrong against me with this library !!! Thank you for your reply ! Romain My code : //création du dbf IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test"); //création du shapefile IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test", ShapeFile.ShapeFile.ShapeType.Point); //nouvelle colonne dans le dbf shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test", ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); //écriture de la valeur liée au futur shape shpFile.DBFWriteStringAttribute(ptrDBFCreate, shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); //création du point double[] x = new double[1]; double[] y = new double[1]; double[] z = new double[1]; x[0] = 803606; y[0] = 803606; z[0] = 0; IntPtr psObject = shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, y, z); //écriture du point dans le shape shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); //fermeture du dbf et du shapefile shpFile.SHPClose(ptrSHPCreate); shpFile.DBFClose(ptrDBFCreate); _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileHello Christian,
My application has to run on a PocketPC, so I tried to create on the PocketPC root (and on my computer root) but nothing appends. I tried to create a simple text file on my SD card and it worked. Thank you for your help. Romain
|
|
|
Re: Adding new shape to shapefile
Hello once more, Romain,
the documentation is here: http://shapelib.maptools.org/shp_api.html Best regards,
Christian Directmedia Publishing GmbH · Möckernstraße 68 · 10965 Berlin www.digitale-bibliothek.de AG Berlin-Charlottenburg · HR B 58002 · USt.Id. DE173211737 Geschäftsführer: Ralf Szymanski · Erwin Jurschitza thecrashteam schrieb: Thank you for your help Bram, it is very nice ! So, I did a list of return values of functions used in my code : DBFCreate returns 375328, SHPCreate = 379776, DBFAddField = 0, DBFWriteStringAttribute = 1, SHPCreateSimpleObject = 410704, SHPWriteObject = 0. I hope you could tell me what these figures mean... And do you know where could I find documentation about shapelib ? Thank you again for your help Romain. Bram de Greve wrote: _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileHi Christian,
I've already read that documentation and it didn't help me. Thank you for your quick reply. I am trying to change the order of execution of the functions (SHPCreate before DBFCreate for example) and try it every order. I don't know if it will change something. Romain. |
|
|
|
|
|
Re: Adding new shape to shapefileOK, this is _really_ weird, as _all_ return values indicate that every
single call was successful. DBFCreate and SHPCreate return values different than zero, meaning they were actually able to create files and return handles to them. DBFAddField return the field number and -1 on failure. 0 just means this is the first field successfully added. DBFWriteStringAttribute returns true on success, 1 is true. SHPCreateSimpleObject returns a handle to an object which is non-zero, and thus a success. SHPWriteObject returns the index of the object within the file. 0 just means this is the first object, and thus a success. So, from everything I can see here, a file _must_ have been created somewhere, as none of these calls (except SHPCreateSimpleObject ) could have been successful if this wasn't the case. As far I as understand shapelib, there is no other way possible. I can imagine only two things: - the filename is doing something funny. Please, try simpler cases. - the C# layer is doing something funny. Who has created the C# library? Maybe he/her can help you better ... Bram thecrashteam wrote: > Thank you for your help Bram, it is very nice ! > So, I did a list of return values of functions used in my code : > DBFCreate returns 375328, > SHPCreate = 379776, > DBFAddField = 0, > DBFWriteStringAttribute = 1, > SHPCreateSimpleObject = 410704, > SHPWriteObject = 0. > > I hope you could tell me what these figures mean... And do you know where > could I find documentation about shapelib ? > > Thank you again for your help > > Romain. > > > > Bram de Greve wrote: > >> The extension has nothing to do with it. At worst, it would create >> something like test.shp.shp. >> >> As no files AT ALL are created, the problem probably is within DBFCreate >> and SHPCreate, as they should create file files straight away, even >> without the data being added. Please, check the return values of >> DBFCreate and SHPCreate. Are they null? Probably they are, and that >> means the creation of the files simply fail. And thus everything else >> fails too. >> >> Try a more simple filename like just "test". >> >> Are you prepared to step through the code in a debug session. Maybe you >> can figure out what exactly fails ... >> >> Good luck =) >> Bram >> >> thecrashteam schreef: >> >>> Hi Vassilis, >>> >>> >>> I tried what you told me too, but it still not work. No error, but no >>> files... It's hopeless !! ^^ >>> I think there is something wrong against me with this library !!! >>> >>> Thank you for your reply ! >>> >>> Romain >>> >>> My code : >>> >>> //création du dbf >>> IntPtr ptrDBFCreate = shpFile.DBFCreate(@"\SD-MMCard\TestParcelle\test"); >>> >>> //création du shapefile >>> IntPtr ptrSHPCreate = shpFile.SHPCreate(@"\SD-MMCard\TestParcelle\test", >>> ShapeFile.ShapeFile.ShapeType.Point); >>> >>> //nouvelle colonne dans le dbf >>> shpFile.DBFAddField(ptrDBFCreate, @"\SD-MMCard\TestParcelle\test", >>> ShapeFile.ShapeFile.DBFFieldType.FTString, 255, 0); >>> >>> //écriture de la valeur liée au futur shape >>> shpFile.DBFWriteStringAttribute(ptrDBFCreate, >>> shpFile.DBFGetRecordCount(ptrDBFCreate), 0, "to"); >>> >>> //création du point >>> double[] x = new double[1]; >>> double[] y = new double[1]; >>> double[] z = new double[1]; >>> x[0] = 803606; >>> y[0] = 803606; >>> z[0] = 0; >>> >>> IntPtr psObject = >>> shpFile.SHPCreateSimpleObject(ShapeFile.ShapeFile.ShapeType.Point, 1, x, >>> y, >>> z); >>> >>> //écriture du point dans le shape >>> shpFile.SHPWriteObject(ptrSHPCreate, -1, psObject); >>> >>> //fermeture du dbf et du shapefile >>> shpFile.SHPClose(ptrSHPCreate); >>> shpFile.DBFClose(ptrDBFCreate); >>> >>> >> _______________________________________________ >> Shapelib mailing list >> Shapelib@... >> http://lists.maptools.org/mailman/listinfo/shapelib >> >> >> > > _______________________________________________ Shapelib mailing list Shapelib@... http://lists.maptools.org/mailman/listinfo/shapelib |
|
|
Re: Adding new shape to shapefileHi,
I have something new. Like you said Bram, my files are created but they are not created in the specified folder. They are created on the system root. But there is something weird. I want to create test.shp, test.shx and test.dbf files but files which are created are named "dbf", "shp" and "shx". They have no extension. Moreover, when I add an extension to my dbf file, in order to view its content, I have a string which does not match with the one I want to put in (I put "to" and it contains " þ"). Even if I want to create my files in another folder (created on the system root for example) they are created on the system root... can you tell me if this is normal? Romain
|
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |