Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • geodist

    Dear all,

    I am a student working for the geodist commission. I am reporting this problem (below). Could you please enlighten me?

    geodist latitude longitude med_X_CENTROID med_Y_CENTROID, generate(dist_center_bdx)
    Was expecting a number or a numeric scalar instead of -latitude-
    r(198);
    storage display value
    variable name type format label variable label
    -------------------------------------------------------------------------------------------------------------------------------------------
    med_X_CENTROID str6 %9s
    med_Y_CENTROID str6 %9s


    Please, you would be of great help to me, Best.


  • #2
    geodist is from SSC, authored by Robert Picard.

    Was expecting a number or a numeric scalar instead of -latitude-
    r(198);
    You need the variables "latitude", "longitude", "med_X_CENTROID" and "med_Y_CENTROID" to be numeric variables. See

    Code:
    help destring

    Comment


    • #3

      Thank you for message,

      I've changed the variables to numeric format format with destring, and this is what the message show: may be I should convert to decimal-degree bu what is the code to use?

      . destring med_X_CENTROID, replace
      med_X_CENTROID has all characters numeric; replaced as long

      . destring med_Y_CENTROID, replace
      med_Y_CENTROID has all characters numeric; replaced as long

      . geodist X_CENTROID Y_CENTROID med_X_CENTROID med_Y_CENTROID , generate(dist_center_bdx)
      latitude 1 must be between -90 and 90
      r(198);

      Please, Best regard,



      Comment


      • #4
        The latitude coordinate refers to how far you are from the Equator. So the North Pole has the latitude coordinate of 90°N and the South Pole has 90°S. Every other place is in-between. You should check why you have values outside (-90 90).

        Comment


        • #5
          Thank you for your answer, it's because I was in Lambert93

          Comment


          • #6
            I am not aware of any Stata command that will do this conversion, but you can use the following website:

            https://geofree.fr/gf/coordinateConv.asp

            Comment

            Working...
            X