exact same code gives different result in server and local hostHow to install PostGIS and pgrouting on...

Injection into a proper class and choice without regularity

Do I need to watch Ant-Man and the Wasp and Captain Marvel before watching Avengers: Endgame?

Mistake in years of experience in resume?

How to pronounce 'c++' in Spanish

Apply a different color ramp to subset of categorized symbols in QGIS?

Was Dennis Ritchie being too modest in this quote about C and Pascal?

Why do games have consumables?

Creating a chemical industry from a medieval tech level without petroleum

A ​Note ​on ​N!

Nails holding drywall

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

A strange hotel

How long after the last departure shall the airport stay open for an emergency return?

Is there metaphorical meaning of "aus der Haft entlassen"?

How do I reattach a shelf to the wall when it ripped out of the wall?

What is this word supposed to be?

What makes accurate emulation of old systems a difficult task?

Von Neumann Extractor - Which bit is retained?

Does a large simulator bay have standard public address announcements?

As an international instructor, should I openly talk about my accent?

Find a stone which is not the lightest one

How exactly does Hawking radiation decrease the mass of black holes?

Co-worker works way more than he should

What does a straight horizontal line above a few notes, after a changed tempo mean?



exact same code gives different result in server and local host


How to install PostGIS and pgrouting on Windows if Stack Builder fails to connect?Having trouble connecting QGIS with postgres database with postgis extensionRebuilding a Polygon from the points within it, in PostGISHow to calculate the start and end lat/lon of a linestring which is not a part of a ST_buffer?Programmatically move points in front of building polygons in PostGISSelecting points within a polygon in PostGISHow do I split polygon in equal parts based on polygon area?Performing PostGIS spatial joins with remote host?Filtering points against polygonGeoDjango vs SQL query gives different results when filtering points in the polygon






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I have a back end that uses Postgis to filter points inside a polygon. Backend is in Django, and here is the code that does the filtering:



def get_queryset(self):
polystr = self.request.query_params.get('poly', None)
if polystr:
poly = GEOSGeometry('SRID=4326;' + polystr)
qs = PropertyPost.objects.filter(location__contained=poly)
return qs


so using that I would be able to filter the points inside a polygon, like this in local host (windows):



http://127.0.0.1:8000/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



the above returns the points inside the polygon.
Now I have 3 points inside the polygon that correctly will be returned by above request.
However I have uploaded my code in digital ocean server on Linux, and the bellow code returns only two points:



http://127.137.139.1/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



I am puzzled that what can cause this. Codes are exactly the same, I usually test things locally and push it to server and everything has been pretty similar so far. So it is odd that it is not working.



Both PostgreSQL (windows and Linux) are 10.6. However Postgis versions are a bit different but I doubt this should make such an issue:



POSTGIS="2.4.3 r16312" on Linux server



POSTGIS="2.4.4 r16526" on local host windows.



Is there some settings that might be different on windows and Linux?









share





























    0















    I have a back end that uses Postgis to filter points inside a polygon. Backend is in Django, and here is the code that does the filtering:



    def get_queryset(self):
    polystr = self.request.query_params.get('poly', None)
    if polystr:
    poly = GEOSGeometry('SRID=4326;' + polystr)
    qs = PropertyPost.objects.filter(location__contained=poly)
    return qs


    so using that I would be able to filter the points inside a polygon, like this in local host (windows):



    http://127.0.0.1:8000/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



    the above returns the points inside the polygon.
    Now I have 3 points inside the polygon that correctly will be returned by above request.
    However I have uploaded my code in digital ocean server on Linux, and the bellow code returns only two points:



    http://127.137.139.1/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



    I am puzzled that what can cause this. Codes are exactly the same, I usually test things locally and push it to server and everything has been pretty similar so far. So it is odd that it is not working.



    Both PostgreSQL (windows and Linux) are 10.6. However Postgis versions are a bit different but I doubt this should make such an issue:



    POSTGIS="2.4.3 r16312" on Linux server



    POSTGIS="2.4.4 r16526" on local host windows.



    Is there some settings that might be different on windows and Linux?









    share

























      0












      0








      0








      I have a back end that uses Postgis to filter points inside a polygon. Backend is in Django, and here is the code that does the filtering:



      def get_queryset(self):
      polystr = self.request.query_params.get('poly', None)
      if polystr:
      poly = GEOSGeometry('SRID=4326;' + polystr)
      qs = PropertyPost.objects.filter(location__contained=poly)
      return qs


      so using that I would be able to filter the points inside a polygon, like this in local host (windows):



      http://127.0.0.1:8000/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



      the above returns the points inside the polygon.
      Now I have 3 points inside the polygon that correctly will be returned by above request.
      However I have uploaded my code in digital ocean server on Linux, and the bellow code returns only two points:



      http://127.137.139.1/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



      I am puzzled that what can cause this. Codes are exactly the same, I usually test things locally and push it to server and everything has been pretty similar so far. So it is odd that it is not working.



      Both PostgreSQL (windows and Linux) are 10.6. However Postgis versions are a bit different but I doubt this should make such an issue:



      POSTGIS="2.4.3 r16312" on Linux server



      POSTGIS="2.4.4 r16526" on local host windows.



      Is there some settings that might be different on windows and Linux?









      share














      I have a back end that uses Postgis to filter points inside a polygon. Backend is in Django, and here is the code that does the filtering:



      def get_queryset(self):
      polystr = self.request.query_params.get('poly', None)
      if polystr:
      poly = GEOSGeometry('SRID=4326;' + polystr)
      qs = PropertyPost.objects.filter(location__contained=poly)
      return qs


      so using that I would be able to filter the points inside a polygon, like this in local host (windows):



      http://127.0.0.1:8000/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



      the above returns the points inside the polygon.
      Now I have 3 points inside the polygon that correctly will be returned by above request.
      However I have uploaded my code in digital ocean server on Linux, and the bellow code returns only two points:



      http://127.137.139.1/prop-posts/?poly=POLYGON((50.844738 28.957921,50.844906 28.959785,50.8433 28.957801,50.844738 28.957921))



      I am puzzled that what can cause this. Codes are exactly the same, I usually test things locally and push it to server and everything has been pretty similar so far. So it is odd that it is not working.



      Both PostgreSQL (windows and Linux) are 10.6. However Postgis versions are a bit different but I doubt this should make such an issue:



      POSTGIS="2.4.3 r16312" on Linux server



      POSTGIS="2.4.4 r16526" on local host windows.



      Is there some settings that might be different on windows and Linux?







      postgis postgresql linux django





      share












      share










      share



      share










      asked 9 mins ago









      Nabat FarsiNabat Farsi

      83




      83






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320904%2fexact-same-code-gives-different-result-in-server-and-local-host%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f320904%2fexact-same-code-gives-different-result-in-server-and-local-host%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...