If you have experience with python, you could use the Shapely library and create a Polygon from the points in the two lines. You will need to tell python what the start and end points of both lines are.
from shapely.geometry import Point, Polygon, LineString
import geopandas as gpd
import pandas as pd
line1 = [(1,1),(2,1.2),(3,1)]
line2 = [(1,2),(2,2.2),(3,2)]
# you need to reverse the order of one line to make it a polygon
line2reverse = list(reversed(line2))
polgonList2 = line1 + line2reverse
Polygon(polgonList2)
Even better: you can also use geopandas to do this. geopandas allows you to easily save to multiple formats including shapefiles
d = {'identifier' : [1, 2],
'name' : ["Netherlands", "Germany"],
"line1": [[(1,1),(2,1.2),(3,1)], [(1,1),(2,1.2),(3,1)]],
"line2": [[(1.1,2.1),(2.1,2.3),(3.1,2.2)],[(1,2),(2,2.2),(3,2)]]
}
df = pd.DataFrame(d)
def makePolygon(row):
line2reverse = list(reversed(row["line2"]))
return Polygon(line1+line2reverse)
geometries = []
for index, row in df.iterrows():
geometries.append(makePolygon(row))
crs = {'init': 'epsg:4326'}
gdf = gpd.GeoDataFrame(df, crs=crs, geometry=geometries)
gdf.to_file('MyGeometries.shp', driver='ESRI Shapefile')
you can read the line geometries using geopandas gpd.read_file() function.
Order of polygon vertices in general GIS: clockwise or counterclockwise
https://nbviewer.jupyter.org/gist/rutgerhofste/b01c17aa6851ea577f10c21a4c3717bc