1

I have GeoJSON file which is obtained from conversion of shape file in QGIS3.10.0. Originally it was created by survey data of electronic total station. Geometric coordinate system then converted to Geographic coordinate system by this way.

* Generated CRS (+proj=cass +lat_0=24.5 +lon_0=90.5 +x_0=100290.75 +y_0=799928 +datum=WGS84 +units=m +no_defs)

EPSG User number given by QGIS is 100025.

My sample GeoJSON file is.

{
  "type": "FeatureCollection",
  "name": "DapuniaSheet2",
  "features": [{
      "type": "Feature",
      "properties": {
        "FID_1": 9,
        "Plot_no": 202,
        "Area_Acres": 0.020135
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [44763.613474926678464, 844875.468655469710939],
              [44804.489758635405451, 844871.151961485273205],
              [44804.257692745421082, 844867.189708364196122],
              [44801.113250943824823, 844867.830209492123686],
              [44773.413093118193501, 844873.472540769726038],
              [44763.613474926678464, 844875.468655469710939]
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "FID_1": 32,
        "Plot_no": 414,
        "Area_Acres": 0.044576
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [45029.32617940990167, 844351.123875642661005],
              [45036.336509591790673, 844351.293015524046496],
              [45037.27196657325112, 844351.21549301513005],
              [45042.447006980044534, 844350.786630839807913],
              [45043.346887172818242, 844350.712056624586694],
              [45045.90737579738925, 844350.499865678255446],
              [45054.303758128371555, 844349.75464953458868],
              [45072.380939356633462, 844349.268230668385513],
              [45079.557863260153681, 844349.172417343826964],
              [45097.324323943576019, 844348.800614793784916],
              [45110.000118871925224, 844349.014180765487254],
              [45109.009727685741382, 844344.8155514447717],
              [45098.352370583961601, 844345.72248393134214],
              [45097.785687126917765, 844345.737655516597442],
              [45090.409485326970753, 844345.935135561623611],
              [45085.054638867768517, 844346.090887796599418],
              [45075.805582954621059, 844346.67029661568813],
              [45072.160970216085843, 844346.895686664036475],
              [45072.15995996145648, 844346.983733439119533],
              [45069.645245395295206, 844347.237438626005314],
              [45065.951194349421712, 844347.610125023173168],
              [45062.200700528395828, 844348.049468386918306],
              [45058.450206707362668, 844348.48881175077986],
              [45055.290394434632617, 844348.599091262905858],
              [45054.226292702092906, 844348.636229108204134],
              [45051.618646888062358, 844348.727237650309689],
              [45047.910231015906902, 844348.854938129079528],
              [45045.775058277606149, 844348.926109780790284],
              [45042.485838503278501, 844349.035749249742366],
              [45039.196618728943577, 844349.145388718578033],
              [45036.243992099371098, 844349.243808537605219],
              [45036.036539501445077, 844349.250723549048416],
              [45029.32617940990167, 844351.123875642661005]
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "FID_1": 141,
        "Plot_no": 410,
        "Area_Acres": 0.184787
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [44749.429949297918938, 844799.490963805816136],
              [44750.26378234897129, 844810.31181428860873],
              [44751.358981607001624, 844824.524476409656927],
              [44752.246271417643584, 844836.039048018166795],
              [44755.666886024584528, 844853.901416639215313],
              [44757.480869232851546, 844855.083176952321082],
              [44758.160627407429274, 844840.502646912354976],
              [44757.897862597987114, 844836.582417561672628],
              [44757.783764894185879, 844832.983276980696246],
              [44757.54948539337056, 844825.593076910590753],
              [44757.429303596356476, 844821.802017421345226],
              [44756.932449962463579, 844813.762147770263255],
              [44756.435596328563406, 844805.722278119064867],
              [44756.687625282705994, 844796.557924250722863],
              [44756.939654236841307, 844787.393570382380858],
              [44756.898076782999851, 844783.601627807249315],
              [44756.882557132565125, 844782.186206279788166],
              [44756.867037482130399, 844780.770784752443433],
              [44756.810742076871975, 844775.636537119280547],
              [44756.779084193389281, 844772.749278157483786],
              [44756.747426309906587, 844769.86201919557061],
              [44756.655048492219066, 844766.071858438081108],
              [44756.531453962648811, 844761.0009101574542],
              [44756.436296827596379, 844755.157764444942586],
              [44756.731741061252251, 844747.135184230632149],
              [44756.935857580734591, 844741.59254381316714],
              [44755.972049884527223, 844715.531170066678897],
              [44755.870542737728101, 844713.320380718214437],
              [44755.738600437347486, 844705.758260112255812],
              [44755.659731260187982, 844691.890904655214399],
              [44755.149888156600355, 844685.078804954886436],
              [44754.837729265731468, 844680.907997363246977],
              [44754.873706029065943, 844679.592184267006814],
              [44754.475512457174773, 844679.835527428658679],
              [44753.978866369172465, 844680.139036670792848],
              [44753.942901370290201, 844680.149211194831878],
              [44753.631668428810372, 844701.108916899305768],
              [44753.417532961750112, 844715.529679525177926],
              [44753.316571549628861, 844724.268675823928788],
              [44752.68480328971782, 844765.902794647379778],
              [44751.110715383831121, 844775.420035690767691],
              [44751.076830274658278, 844775.90531801036559],
              [44749.996735709522909, 844791.373787316144444],
              [44749.429949297918938, 844799.490963805816136]
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "FID_1": 0,
        "Plot_no": 373,
        "Area_Acres": 0.007455
      },
      "geometry": {
        "type": "MultiPolygon",
        "coordinates": [
          [
            [
              [45065.307970583722636, 844397.072644855594262],
              [45069.735295446938835, 844406.418877056799829],
              [45070.928573462064378, 844406.40604682918638],
              [45070.560387596640794, 844397.143676241976209],
              [45070.556555402865342, 844397.047270588809624],
              [45065.307970583722636, 844397.072644855594262]
            ]
          ]
        ]
      }
    }
  ]
}

Now I want to adjust CRS to EPSG 3857 and EPSG 4326 for viewing this as global aspect. How I can proceed for converting CRS?

2
  • 100025 is not EPSG code. When I tried CRS definition as it is with proj4, it showed location in Bangladesh. Is that correct?
    – TomazicM
    Feb 22 '20 at 18:02
  • Yes. It is Bangladesh.@TomazicM
    – Abdul Aziz
    Feb 23 '20 at 3:10
3

If you want to use projection other than EPSG:3857 or EPSG:4326 in Leaflet, you have to use Proj4Leaflet plugin (see https://github.com/kartena/Proj4Leaflet) to define your projection.

Leaflet allows only one CRS per map, so if your base map CRS is in EPSG:3857, you have to convert GeojSON coordinates from GeoJSON CRS (in your case that's non standard, custom CRS) to map CRS. That can be done on the fly using coordsToLatLng option of L.geoJSON layer when loading GeoJSON. For unprojecting GeoJSON projected coordinates to standard GeoJSON EPSG:4326 coordinates, projection's unproject method is used.

In your case that could look something like:

var geoJSON_data = { ... };

var myCRS = new L.Proj.CRS('myCRS', '+proj=cass +lat_0=24.5 +lon_0=90.5 +x_0=100290.75 +y_0=799928 +datum=WGS84 +units=m +no_defs');

var map = L.map('map');
L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}', {
  maxZoom: 20,
  subdomains: ['mt0', 'mt1', 'mt2', 'mt3']
}).addTo(map);

function coordsToLatLng(coords) {
  var latLng = myCRS.unproject(L.point(coords[0], coords[1]));
  return latLng;
};

var myLayer = L.geoJSON(geoJSON_data, {
  coordsToLatLng: coordsToLatLng
}).addTo(map);

map.fitBounds(myLayer.getBounds());
1
  • Thank you very much for your help @TomazicM
    – Abdul Aziz
    Feb 24 '20 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.