Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting shapefiles of PT & IV #22

Open
pankajkmishra opened this issue Mar 20, 2024 · 1 comment · Fixed by #28
Open

Exporting shapefiles of PT & IV #22

pankajkmishra opened this issue Mar 20, 2024 · 1 comment · Fixed by #28

Comments

@pankajkmishra
Copy link

Trying to create PT & IV shapefiles from EDI directory

import os
from mtpy.utils.shapefiles import create_phase_tensor_shpfiles, create_tipper_shpfiles

edi_dir = "EDI"
save_dir_edi = "SHAPE"
if not os.path.exists(save_dir_edi):
    os.makedirs(save_dir_edi)
create_phase_tensor_shpfiles(edi_dir, save_dir_edi, proj="WGS84", ellipse_size=1000)
create_tipper_shpfiles(edi_dir, save_dir_edi)

Gives the following error


ImportError Traceback (most recent call last)
Cell In[12], line 2
1 import os
----> 2 from mtpy.utils.shapefiles import create_phase_tensor_shpfiles, create_tipper_shpfiles
4 # Define the path to your directory containing EDI files
5 edi_dir = "EDI"

File c:\Users\pmishra\Anaconda3\envs\mtpy\lib\site-packages\mtpy\utils\shapefiles.py:11
2 """
3 Create shape files for phase tensor ellipses.
4 https://pcjericks.github.io/py-gdalogr-cookbook/vector_layers.html#create-a-new-shapefile-and-add-data
(...)
8 @author: jrpeacock
9 """
10 import mtpy.modeling.modem
---> 11 from mtpy.utils.gis_tools import project_point_ll2utm, get_utm_zone
13 try:
14 from osgeo import ogr, gdal, osr

ImportError: cannot import name 'get_utm_zone' from 'mtpy.utils.gis_tools' (c:\Users\pmishra\Anaconda3\envs\mtpy\lib\site-packages\mtpy\utils\gis_tools.py)

@kujaku11
Copy link
Contributor

@pankajkmishra Thanks for the issue, support for making shapefiles has yet been translated over to v2. Hopefully in the next few weeks. Suggest using the original version for now.

@kujaku11 kujaku11 linked a pull request Apr 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants