Skip to content

Commit

Permalink
Adding tests to write and check the version 2.0 of the format
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelPau committed Apr 10, 2024
1 parent 106815e commit 61a93ad
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions autotest/ogr/ogr_miramon_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_ogr_miramon_read_simple_point():
check_simple_point(ds)


def test_ogr_miramon_write_simple_point(tmp_vsimem):
def test_ogr_miramon_write_simple_pointV11(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.pnt")
gdal.VectorTranslate(
Expand All @@ -103,6 +103,20 @@ def test_ogr_miramon_write_simple_point(tmp_vsimem):
check_simple_point(ds)


def test_ogr_miramon_write_simple_pointV20(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.pnt")
gdal.VectorTranslate(
out_filename,
"data/miramon/Points/SimplePoints/SimplePointsFile.pnt",
format="MiraMonVector",
options="-lco Version=2.0",
)

ds = gdal.OpenEx(out_filename, gdal.OF_VECTOR)
check_simple_point(ds)


###############################################################################
# basic linestring test

Expand Down Expand Up @@ -183,7 +197,7 @@ def test_ogr_miramon_read_simple_arc():
check_simple_arc(ds)


def test_ogr_miramon_write_simple_arc(tmp_vsimem):
def test_ogr_miramon_write_simple_arcV11(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.arc")
gdal.VectorTranslate(
Expand All @@ -196,6 +210,20 @@ def test_ogr_miramon_write_simple_arc(tmp_vsimem):
del ds


def test_ogr_miramon_write_simple_arcV20(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.arc")
gdal.VectorTranslate(
out_filename,
"data/miramon/Arcs/SimpleArcs/SimpleArcFile.arc",
format="MiraMonVector",
options="-lco Version=2.0",
)
ds = gdal.OpenEx(out_filename, gdal.OF_VECTOR)
check_simple_arc(ds)
del ds


###############################################################################
# basic polygon test

Expand Down Expand Up @@ -268,13 +296,26 @@ def test_ogr_miramon_read_simple_polygon():
check_simple_polygon(ds)


def test_ogr_miramon_write_simple_polygon(tmp_vsimem):
def test_ogr_miramon_write_simple_polygonV11(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.pol")
gdal.VectorTranslate(
out_filename,
"data/miramon/Polygons/SimplePolygons/SimplePolFile.pol",
format="MiraMonVector",
)
ds = gdal.OpenEx(out_filename, gdal.OF_VECTOR)
check_simple_polygon(ds)


def test_ogr_miramon_write_simple_polygonV20(tmp_vsimem):

out_filename = str(tmp_vsimem / "out.pol")
gdal.VectorTranslate(
out_filename,
"data/miramon/Polygons/SimplePolygons/SimplePolFile.pol",
format="MiraMonVector",
options="-lco Version=2.0",
)
ds = gdal.OpenEx(out_filename, gdal.OF_VECTOR)
check_simple_polygon(ds)
Expand Down

0 comments on commit 61a93ad

Please sign in to comment.