Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonathan Lambrechts
seamsh
Commits
accb3fde
Commit
accb3fde
authored
Jul 02, 2020
by
Jonathan Lambrechts
Browse files
testshp
parent
27398a4f
Pipeline
#7875
failed with stages
in 54 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
demo/testshp.py
0 → 100644
View file @
accb3fde
import
msea
from
msea.geometry
import
CurveType
import
numpy
as
np
from
osgeo
import
osr
def
mesh_size
(
x
,
projection
)
:
s_coast
=
np
.
clip
((
dist_coast_field
(
x
,
projection
)
-
400
)
*
0.5
,
200
,
5000
)
s_porquerolles
=
np
.
clip
((
dist_porquerolles_field
(
x
,
projection
)
-
200
)
*
0.5
,
50
,
5000
)
return
np
.
minimum
(
s_coast
,
s_porquerolles
)
domain_srs
=
osr
.
SpatialReference
()
domain_srs
.
ImportFromEPSG
(
32631
)
#domain_srs.ImportFromProj4("+proj=utm +ellps=WGS84 +zone=31")
domain
=
msea
.
geometry
.
Domain
(
domain_srs
)
domain
.
add_boundary_curves_shp
(
"test/data_no_duplicate.shp"
,
"physical"
,
CurveType
.
POLYLINE
)
#domain.add_interior_curves_shp("test/interior.shp",None,CurveType.STRICTPOLYLINE)
#domain.add_interior_points_shp("test/interior.shp")
bath_field
=
msea
.
field
.
Raster
(
"medit.tiff"
)
dist_coast_field
=
msea
.
field
.
Distance
(
domain
,
100
,[
"coast"
,
"island"
])
dist_porquerolles_field
=
msea
.
field
.
Distance
(
domain
,
20
,[
"porquerolles"
])
#coarse = msea.geometry.coarsen_boundaries(domain,(8e5,4.68e6),domain_srs,mesh_size,20)
msea
.
gmsh
.
mesh
(
domain
,
"test.msh"
,
mesh_size
,
intermediate_file_name
=
"log"
)
msea
.
gmsh
.
convert_to_gis
(
"test.msh"
,
domain_srs
,
"test.gpkg"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment