extraction - How can I extract x, y and z coordinates from geographical data by Python? -


I have geographic data in which 14 variables are in the following format:

QUADNAME : Rockport_colony_SD resolution: 10 ULLAT: 43.625
ULLON: -9 7.8,75,27,466 LRLAT: 43.5
LRLON: -9 7.7,50,27,466 HDATUM: 27
Zmin: 361.58401489 Zmax: 413.38400269 ZMEAN: 396.1293335 ZSIGMA: 12.36359215 PMETHOD: 5
QUADDATE:. 20,001,001

There are no previous variables in the entire data sequence

How can I remove coordinates for ULLAT, ULLAN and LRLAT in three lists from the data, so that each row one Match the location?

This question was raised by the problem.

This can be a big task if the data is in a large flat text file:

  import again data = "" "QUADNAME: rockport_colony_SD resolution: 10 ULLAT: 43.625 ULLON: -9 7.8,75,27,466 LRLAT: 43.5 LRLON: -9 7.7,50,27,466 HDATUM: 27 Zmin: 361.5,84,01,48 9 Zmax: 413.3,84,00,269 ZMEAN: 39 6.12, 93,335 ZSIGMA: 1 2.36359215 PMETHOD: 5 QUADDATE: 20,001,001 "" "regex = re .compile (r "" ULLAT ?. (P & LT; ullat & gt; - [. \ D]) *? ULLON: \ (? P & lt; ullon> -? [\ D.] +). *? LRLAT: \ (? P & lt; lrlat & gt; - [\ d.]?) "", Re.DOTALL | re.VERBOSE) print regex.findall (data) # yield: [('43. 625 ',' 7.89.7 , 27466 ', '43 .5')]  

Comments