Skip to content

very small numbers get written into URLs with error-raising scientific notation #108

@itcarroll

Description

@itcarroll

A very small number, for instance a coordinate very close to the equator, can get written to string as scientific notation when cmr.queries.Query._build_url() is called. For example:

from cmr import GranuleQuery

q = GranuleQuery().short_name("FOO").point(42, 0.00001)
q._build_url()
'https://cmr.earthdata.nasa.gov/search/granules.json?short_name=FOO&point[]=42.0,1e-05'

To this request, CMR responds:

{"errors":["[42.0,1e-05] is not a valid URL encoded point"]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions