Welcome, Guest
Username: Password: Remember me

TOPIC: Converting shp file into i2s file

Converting shp file into i2s file 3 years 3 months ago #39041

  • R.Wei
  • R.Wei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 7
Hi all,

I have one shp file consisting of outlines of buildings. When I use converter.py to convert shp file into i2s file, it reported an error like:
Traceback (most recent call last):
File "/home/oem/Telemac/v8p2r0/scripts/python3/converter.py", line 295, in <module>
main()
File "/home/oem/Telemac/v8p2r0/scripts/python3/converter.py", line 273, in main
write_poly_txt(poly, options.txt_file)
File "/home/oem/Telemac/v8p2r0/scripts/python3/data_manip/extraction/shapefile_reader.py", line 160, in write_poly_txt
ffile.write("{} {} \n".format(point[0], point[1]))
IndexError: list index out of range

But one i2s file was generated anyway, but this file cannot be opened by bluekenue. I compared the format of the converted i2s file with the one directly generated by BK, it's clear that the format is quite different yet I have no idea how to fix it. May you please check the converted i2s file?
Besides, if it's not the expected way convert shp file, may you please tell me which tool works?

Hereafter is the screenshot of the converted i2s file.


Regards,
R.Wei
Attachments:
The administrator has disabled public write access.

Converting shp file into i2s file 3 years 2 months ago #39048

  • Kany
  • Kany's Avatar
Hi,

Sorry I dont know much about the converter.py...

But I import shp file in BK and using bounding line through Tools menu->extract line subset. This will give you i2s from required area of shp file.
The administrator has disabled public write access.

Converting shp file into i2s file 3 years 2 months ago #39064

  • Serrer
  • Serrer's Avatar
  • OFFLINE
  • Moderator
  • Posts: 720
  • Thank you received: 304
Blue Kenue can also export the entire lineSet component of a
shapefile to an i2s file using "File->Save Copy As..."
The i2s/i3s file format is explained in detail in the BlueKenue Reference manual.

Cheers... Martin

BTW:
converter.py is not associated with BlueKenue developers in any way.
This post probably belongs in the "Scripts" section of this FORUM.
The administrator has disabled public write access.
The following user(s) said Thank You: Kany

Converting shp file into i2s file 3 years 2 months ago #39097

  • R.Wei
  • R.Wei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 7
Thank you for your help. I didn't know shp file can be directly imported in BK and that's way much smooth since there can be some unexpected bugs during conversion process.
The administrator has disabled public write access.

Converting shp file into i2s file 3 years 2 months ago #39050

  • R.Wei
  • R.Wei's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 33
  • Thank you received: 7
Update: I have found one useful tool in github:https://github.com/CNR-Engineering/telemac_toolbox. The file shap2i2s.py works out.
The administrator has disabled public write access.
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.