Skip to main content
replaced http://gis.stackexchange.com/ with https://gis.stackexchange.com/
Source Link

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answeranswer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. Or you could store the entire line is a line object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. Or you could store the entire line is a line object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. Or you could store the entire line is a line object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

added 53 characters in body
Source Link
djq
  • 16.3k
  • 31
  • 112
  • 182

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. Or you could store the entire line is a line object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. Or you could store the entire line is a line object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.

Source Link
djq
  • 16.3k
  • 31
  • 112
  • 182

As a starting point, you don't need to use geodjango for this! You could simply return unique_line_id, line_start_point_lat, line_start_point_lon, line_end_point_lat, line_end_point_lon as a json object and display these using Leaflet. You will need to structure the data to match the format required - here's an answer that explains how to load a polyline. With Leaflet you can adjust the bounds of the map to fit all of the objects returned.

Once you get this working, if there are limitations you could use geodjango to improve the approach. Instead of having separate columns for lat and lon, you could store a point object which contains the lat/lon as part of this object. For now, I recommend getting a minimal version working so that you can understand how the pieces fit together.