Checked for duplicates
Yes - I've already checked
π§βπ¬ User Persona(s)
Data User, GIS Analyst, Spreadsheet User, Data Analyst
πͺ Motivation
...so that I can easily import PDS data into GIS tools, spreadsheets, and analytics platforms with spatial metadata in dedicated, flattened columns.
π Additional Details
Current Behavior:
- β
Can export DataFrame to CSV via
df.to_csv()
- β Spatial fields remain nested (e.g.,
orex:Spatial.orex:latitude)
- β No automatic extraction of spatial metadata
- β Users must manually flatten nested structures
Proposed Solution:
Export with spatial metadata automatically extracted and flattened:
# Basic CSV export with spatial extraction
products.has_target("Mars").observationals().as_csv(
"mars_data.csv",
extract_spatial=True,
spatial_fields={
"latitude": "orex:Spatial.orex:latitude",
"longitude": "orex:Spatial.orex:longitude",
"range_km": "orex:Spatial.orex:target_range"
}
)
# Auto-detect common spatial field patterns
products.as_csv(
"data.csv",
extract_spatial="auto"
)
# Custom column renaming for readability
products.as_csv(
"data.csv",
extract_spatial=True,
column_mapping={
"pds:Identification_Area.pds:title": "title",
"pds:Time_Coordinates.pds:start_date_time": "start_date"
}
)
Example Output:
Without extraction:
lidvid,title,orex:Spatial
urn:...,Mars Image,"{'orex:latitude': 12.5, 'orex:longitude': -45.2}"
With extraction:
lidvid,title,latitude,longitude,range_km
urn:...,Mars Image,12.5,-45.2,5000.0
Implementation Approach:
- Add
as_csv() method to QueryBuilder
extract_spatial parameter with bool and "auto" support
- Auto-detect common spatial field patterns
flatten option for all nested structures
column_mapping for custom renaming
- Default friendly names for common PDS fields
Related:
For Internal Dev Team To Complete
Acceptance Criteria
Given a user wants to export spatial data for GIS tools
When I perform products.as_csv("output.csv", extract_spatial=True, spatial_fields={...})
Then I expect a CSV file with spatial metadata in separate, flattened columns
βοΈ Engineering Details
To be filled by Engineering Node Team
π I&T
To be filled by Engineering Node Team
Checked for duplicates
Yes - I've already checked
π§βπ¬ User Persona(s)
Data User, GIS Analyst, Spreadsheet User, Data Analyst
πͺ Motivation
...so that I can easily import PDS data into GIS tools, spreadsheets, and analytics platforms with spatial metadata in dedicated, flattened columns.
π Additional Details
Current Behavior:
df.to_csv()orex:Spatial.orex:latitude)Proposed Solution:
Export with spatial metadata automatically extracted and flattened:
Example Output:
Without extraction:
With extraction:
Implementation Approach:
as_csv()method to QueryBuilderextract_spatialparameter with bool and "auto" supportflattenoption for all nested structurescolumn_mappingfor custom renamingRelated:
For Internal Dev Team To Complete
Acceptance Criteria
Given a user wants to export spatial data for GIS tools
When I perform
products.as_csv("output.csv", extract_spatial=True, spatial_fields={...})Then I expect a CSV file with spatial metadata in separate, flattened columns
βοΈ Engineering Details
To be filled by Engineering Node Team
π I&T
To be filled by Engineering Node Team