# HG changeset patch # User iuc # Date 1763505981 0 # Node ID 402faa5eab629a8b542118c05b1aebbc09f05efb # Parent fb5081261c10a213b85d7a903c9f8e08fee19abe planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tools/geopandas commit 28236fa503017adc781fc8e7bee547eeb44182f2 diff -r fb5081261c10 -r 402faa5eab62 table2geojson.xml --- a/table2geojson.xml Mon Jun 30 09:28:17 2025 +0000 +++ b/table2geojson.xml Tue Nov 18 22:46:21 2025 +0000 @@ -1,10 +1,10 @@ - + 1.1.1 - 0 + 1 + 24.2 - geopandas @@ -16,23 +16,26 @@ import json import pandas as pd import geopandas as gpd -df = pd.read_csv('$infile', encoding="utf-8") + +df = pd.read_csv('$infile', encoding="utf-8", sep=None, engine='python', header=None if '$has_header' == "false" else 0) -#set exc = [int($col) - 1 for $col in $exclude_columns] -#set inc = [int($col) - 1 for $col in $include_columns] +inc = [int(x)-1 for x in str('$include_columns').split(",") if x.strip().isdigit()] if '$include_columns' and str('$include_columns').lower() != "none" else [] +exc = [int(x)-1 for x in str('$exclude_columns').split(",") if x.strip().isdigit()] if '$exclude_columns' and str('$exclude_columns').lower() != "none" else [] + property_df = df -if "$include_columns" != "None": - property_df = df.iloc[:, $inc] +if inc: + property_df = df.iloc[:, inc] +if exc: + property_df = property_df.drop(columns=df.columns[exc]) -if "$exclude_columns" != "None": - property_df = df.drop(columns=df.columns[$exc]) - gdf = gpd.GeoDataFrame( property_df, - geometry=gpd.points_from_xy(df.iloc[:,$lat_column-1], df.iloc[:,$long_column-1]), - crs="$crs", - ) + geometry=gpd.points_from_xy( + df.iloc[:, int($lat_column)-1], + df.iloc[:, int($long_column)-1]), + crs="$crs" +) # drop_id: bool, default: False data = json.loads(gdf.to_json()) @@ -43,8 +46,9 @@ - - + + + + @@ -78,7 +83,21 @@ + + + + + + + + + + + + + + @@ -95,6 +114,7 @@ + diff -r fb5081261c10 -r 402faa5eab62 test-data/geolocation_without_header.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/geolocation_without_header.csv Tue Nov 18 22:46:21 2025 +0000 @@ -0,0 +1,20 @@ +37.7749,-122.4194,2023-01-01T12:00:00Z,10,23 +37.7751,-122.4190,2023-01-01T12:05:00Z,15,23 +37.7753,-122.4185,2023-01-01T12:10:00Z,20,23 +37.7755,-122.4180,2023-01-01T12:15:00Z,25,24 +37.7757,-122.4175,2023-01-01T12:20:00Z,30,25 +37.7759,-122.4170,2023-01-01T12:25:00Z,35,23 +37.7761,-122.4165,2023-01-01T12:30:00Z,40,23 +37.7763,-122.4160,2023-01-01T12:35:00Z,45,23 +37.7765,-122.4155,2023-01-01T12:40:00Z,50,23 +37.7767,-122.4150,2023-01-01T12:45:00Z,55,23 +37.7769,-122.4145,2023-01-01T12:50:00Z,60,23 +37.7771,-122.4140,2023-01-01T12:55:00Z,65,23 +37.7773,-122.4135,2023-01-01T13:00:00Z,70,23 +37.7775,-122.4130,2023-01-01T13:05:00Z,75,23 +37.7777,-122.4125,2023-01-01T13:10:00Z,80,23 +37.7779,-122.4120,2023-01-01T13:15:00Z,85,23 +37.7781,-122.4115,2023-01-01T13:20:00Z,90,23 +37.7783,-122.4110,2023-01-01T13:25:00Z,95,23 +37.7785,-122.4105,2023-01-01T13:30:00Z,100,23 +37.7787,-122.4100,2023-01-01T13:35:00Z,105,23 \ No newline at end of file