Is it possible to get values from "Fields"

Hello,

I have two question. Is this possible to get longitude and latitude values from the GeoPointField? I mean, when I pick the point, I want to also get Lat and Lon values in an array or list or etc.

Same question for the any fields. Here is the example:

page_3.des_spectral_str.material_type = OptionField('Category', options=get_material_options)
page_3.des_spectral_str.not_in_params = Text(f'My static text is {page_3.des_spectral_str.material_type}')

I want to write or get the value that I defined in Field (for example A14)

Thanks.

For some fields this is possible. For example, the options in an OptionField can be dynamic (i.e. depending on the value of another field). In that sense, the options in this field can depend on the longitude and latitude values of a GeoPointField.

Your example uses Text, which is explicitly for static text (i.e. does not dependent on the value of other fields).

Can you tell us what you want to achieve? Then we can think along to get a solution for your problem.

Hi Bas van der Hulst,

I have parameter.xlsx file that includes spectral informations about the specific lon. and lat. for Turkish Seismic Hazard Map. I produced the other points informations (not exact, like a specific point that you choice on the map) help wil Bilinear Interpolation. Cause of that I need to read the lon. and lat. values to get to datas from the .xlsx file.

User can write the coordinates manually this the first solution but I thought, is this possible to do it with GeoPoint.

I hope its clear to define my question.

Thanks.

The GeoPointField returns a GeoPoint in the params, from which you can obtain the latitude and longitude.

def my_controller_method(self, params, **kwargs):
    geo_point = params.my_geo_point_field
    lat = geo_point.lat
    lon = geo_point.lon
1 Like

Hi,

Thanks for the answer. It is solved my problem.