Instructions: Your task is to decide which interventions need to be done at which agricultural plots (crops, type='ag_plot') based on how the interventions affect NPV. The choice is between margin (convert only the margins) and habitat (convert a contiguous region) interventions. The interventions can be fractional. Existing habitat plots (type='hab_plots') remain unaffected. The NPV is calculated based on how the interventions affect pollination and pest control services over distance and time, and how these affect yield. There is a tradeoff between the cost of implementation and maintenance vs the benefit of increased yield. I will show you examples of initial input geojson and the output interventions suggested by Pyomo optimization for your neighbouring farms. In the input geojson, the id for each plot is in 'id', land use class in 'label', whether ag_plot ot hab_plot in 'type', yield in 'yield, and and polygon in 'geometry'. In the output, only plots having non-zero interventions are shown, and the rest of the plots have zero interventions. Given these examples, provided input geojson of your farm, you need to predict the final interventions using heuristics created in python. Look at properties that you think have a pattern (like yield, label, type, geometry, do not use plot_ids to assign rules). You can compute metrics using these variables and others, and can even look at the graphical structure of the farms. You can incorporate the parameters like crop prices and implementation and maintenance costs provided at the end in your heuristics. 

Data:

Neighbour 1: input: {"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"label": "Broadleaf", "type": "hab_plots", "id": 1, "yield": 2.8913626521299998}, "geometry": {"type": "Polygon", "coordinates": [[[62.844010370134676, 92.76087073571033], [55.0, 91.10712500734084], [55.0, 95.0], [45.0, 100.0], [65.0, 100.0], [67.69876235938175, 99.10041254687275], [62.844010370134676, 92.76087073571033]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 2, "yield": 2.49122591337}, "geometry": {"type": "Polygon", "coordinates": [[[62.422696347364386, 75.1398127848785], [62.806851712383775, 73.3482847945542], [62.71829087703739, 73.2078529328931], [55.0, 70.76975044928804], [55.0, 80.28507176960207], [62.422696347364386, 75.1398127848785]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 3, "yield": 2.54648059192}, "geometry": {"type": "Polygon", "coordinates": [[[62.71829087703739, 73.2078529328931], [62.806851712383775, 73.3482847945542], [75.59210154511267, 70.59210154511267], [70.0, 65.0], [62.23052410899129, 67.5898252970029], [62.71829087703739, 73.2078529328931]]]}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 4, "yield": 2.10801145417}, "geometry": {"type": "Polygon", "coordinates": [[[62.71829087703739, 73.2078529328931], [62.23052410899129, 67.5898252970029], [55.0, 70.0], [55.0, 70.76975044928804], [62.71829087703739, 73.2078529328931]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 5, "yield": 2.6199581846199997}, "geometry": {"type": "Polygon", "coordinates": [[[55.0, 80.28507176960207], [55.0, 89.32227104042443], [67.54525576156946, 82.09642619099384], [62.422696347364386, 75.1398127848785], [55.0, 80.28507176960207]]]}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 6, "yield": 2.6210248863000003}, "geometry": {"type": "Polygon", "coordinates": [[[55.0, 89.32227104042443], [55.0, 91.10712500734084], [62.844010370134676, 92.76087073571033], [66.2701014897187, 92.20976970138204], [73.48098383676657, 82.231924583095], [67.54525576156946, 82.09642619099384], [55.0, 89.32227104042443]]]}}, {"type": "Feature", "properties": {"label": "Grassland", "type": "hab_plots", "id": 7, "yield": 2.10801145417}, "geometry": {"type": "Polygon", "coordinates": [[[66.2701014897187, 92.20976970138204], [62.844010370134676, 92.76087073571033], [67.69876235938175, 99.10041254687275], [76.72867774331597, 96.090440752228], [66.2701014897187, 92.20976970138204]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 8, "yield": 2.59051019914}, "geometry": {"type": "Polygon", "coordinates": [[[62.806851712383775, 73.3482847945542], [62.422696347364386, 75.1398127848785], [67.54525576156946, 82.09642619099384], [73.48098383676657, 82.231924583095], [84.90470087901015, 79.90470087901016], [75.59210154511267, 70.59210154511267], [62.806851712383775, 73.3482847945542]]]}}, {"type": "Feature", "properties": {"label": "Grassland", "type": "hab_plots", "id": 9, "yield": 2.6210248863000003}, "geometry": {"type": "Polygon", "coordinates": [[[73.48098383676657, 82.231924583095], [66.2701014897187, 92.20976970138204], [76.72867774331597, 96.090440752228], [80.0, 95.0], [85.0, 80.0], [84.90470087901015, 79.90470087901016], [73.48098383676657, 82.231924583095]]]}}]}

Output: {"type": "FeatureCollection", "name": "output_gt", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 4, "yield": 2.10801145417, "margin_intervention": 1.0, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 5, "yield": 2.6199581846199997, "margin_intervention": 1.0, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 6, "yield": 2.6210248863000003, "margin_intervention": 1.0, "habitat_conversion": 0.0}}]}

Neighbour 2: input: {"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"label": "Broadleaf", "type": "hab_plots", "id": 1, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[3.79092127444394, 47.507746709568664], [6.950503612786814, 45.411884318562954], [13.866297373640442, 35.0], [0.0, 35.0], [0.0, 49.04098380215751], [3.79092127444394, 47.507746709568664]]]}}, {"type": "Feature", "properties": {"label": "Corn", "type": "ag_plot", "id": 2, "yield": 2.4580683244799997}, "geometry": {"type": "Polygon", "coordinates": [[[14.828445951301166, 59.34576064956489], [14.253200310368763, 54.58772110806867], [12.46771157815166, 52.15464144729916], [3.79092127444394, 47.507746709568664], [0.0, 49.04098380215751], [0.0, 65.0], [8.147491200265964, 65.0], [14.828445951301166, 59.34576064956489]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 3, "yield": 2.68434075533}, "geometry": {"type": "Polygon", "coordinates": [[[12.46771157815166, 52.15464144729916], [21.40741271330687, 52.72285339992867], [21.980226926930918, 48.203084832694], [6.950503612786814, 45.411884318562954], [3.79092127444394, 47.507746709568664], [12.46771157815166, 52.15464144729916]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 4, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[14.828445951301166, 59.34576064956489], [22.056147869568672, 56.06836203267646], [21.424734872401988, 52.907750524783054], [14.253200310368763, 54.58772110806867], [14.828445951301166, 59.34576064956489]]]}}, {"type": "Feature", "properties": {"label": "Barley", "type": "ag_plot", "id": 5, "yield": 2.59051019914}, "geometry": {"type": "Polygon", "coordinates": [[[14.253200310368763, 54.58772110806867], [21.424734872401988, 52.907750524783054], [21.40741271330687, 52.72285339992867], [12.46771157815166, 52.15464144729916], [14.253200310368763, 54.58772110806867]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 6, "yield": 2.49122591337}, "geometry": {"type": "Polygon", "coordinates": [[[26.003191121761873, 43.50685071031314], [21.980226926930918, 48.203084832694], [21.40741271330687, 52.72285339992867], [21.424734872401988, 52.907750524783054], [22.056147869568672, 56.06836203267646], [31.097766960520058, 65.0], [40.0, 65.0], [30.0, 60.0], [30.0, 50.0], [34.71196632458596, 45.28803367541404], [26.003191121761873, 43.50685071031314]]]}}, {"type": "Feature", "properties": {"label": "Broadleaf", "type": "hab_plots", "id": 7, "yield": 1.6948931827}, "geometry": {"type": "Polygon", "coordinates": [[[22.056147869568672, 56.06836203267646], [14.828445951301166, 59.34576064956489], [8.147491200265964, 65.0], [31.097766960520058, 65.0], [22.056147869568672, 56.06836203267646]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 8, "yield": 2.2448700065200002}, "geometry": {"type": "Polygon", "coordinates": [[[26.003191121761873, 43.50685071031314], [34.71196632458596, 45.28803367541404], [40.0, 40.0], [45.0, 40.0], [45.0, 35.0], [21.587161043157852, 35.0], [26.003191121761873, 43.50685071031314]]]}}, {"type": "Feature", "properties": {"label": "Oats", "type": "ag_plot", "id": 9, "yield": 1.69809901566}, "geometry": {"type": "Polygon", "coordinates": [[[21.980226926930918, 48.203084832694], [26.003191121761873, 43.50685071031314], [21.587161043157852, 35.0], [13.866297373640442, 35.0], [6.950503612786814, 45.411884318562954], [21.980226926930918, 48.203084832694]]]}}]}

Output: {"type": "FeatureCollection", "name": "output_gt", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 3, "yield": 2.68434075533, "margin_intervention": 1.0, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 4, "yield": 0.5, "margin_intervention": 1.0, "habitat_conversion": 1.0}}, {"type": "Feature", "properties": {"label": "Barley", "type": "ag_plot", "id": 5, "yield": 2.59051019914, "margin_intervention": 1.0, "habitat_conversion": 1.0}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 6, "yield": 2.49122591337, "margin_intervention": 1.0, "habitat_conversion": 0.0}}]}

Neighbour 3: input: {"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 1, "yield": 2.77115452086}, "geometry": {"type": "Polygon", "coordinates": [[[39.41525620214523, 58.31586970643804], [41.71476102414392, 54.82007291962681], [41.325412837384796, 46.062314296901896], [39.699861624218634, 40.300138375781366], [30.0, 50.0], [30.0, 60.0], [34.58607275208879, 62.2930363760444], [39.41525620214523, 58.31586970643804]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 2, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[41.325412837384796, 46.062314296901896], [56.81816873773912, 49.50390091852417], [57.58588228621619, 49.40784942760555], [60.89279229682197, 42.873429214436506], [61.369938280719424, 41.369938280719424], [60.0, 40.0], [40.0, 40.0], [39.699861624218634, 40.300138375781366], [41.325412837384796, 46.062314296901896]]]}}, {"type": "Feature", "properties": {"label": "Oats", "type": "ag_plot", "id": 3, "yield": 2.54648059192}, "geometry": {"type": "Polygon", "coordinates": [[[53.38321973084315, 67.4952699571065], [39.41525620214523, 58.31586970643804], [34.58607275208879, 62.2930363760444], [40.0, 65.0], [53.614585547448655, 69.53819518248288], [53.38321973084315, 67.4952699571065]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 4, "yield": 1.57057809328}, "geometry": {"type": "Polygon", "coordinates": [[[58.5202912524621, 57.105324451575164], [55.279989940949534, 60.09910914785869], [53.38321973084315, 67.4952699571065], [53.614585547448655, 69.53819518248288], [55.0, 70.0], [70.0, 65.0], [70.0, 61.05009607786669], [58.5202912524621, 57.105324451575164]]]}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 5, "yield": 2.8164643300799996}, "geometry": {"type": "Polygon", "coordinates": [[[55.279989940949534, 60.09910914785869], [44.64214534340594, 55.109535331484736], [41.71476102414392, 54.82007291962681], [39.41525620214523, 58.31586970643804], [53.38321973084315, 67.4952699571065], [55.279989940949534, 60.09910914785869]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 6, "yield": 1.5964614396}, "geometry": {"type": "Polygon", "coordinates": [[[56.81816873773912, 49.50390091852417], [41.325412837384796, 46.062314296901896], [41.71476102414392, 54.82007291962681], [44.64214534340594, 55.109535331484736], [56.81816873773912, 49.50390091852417]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 7, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[44.64214534340594, 55.109535331484736], [55.279989940949534, 60.09910914785869], [58.5202912524621, 57.105324451575164], [57.58588228621619, 49.40784942760555], [56.81816873773912, 49.50390091852417], [44.64214534340594, 55.109535331484736]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 8, "yield": 2.6210248863000003}, "geometry": {"type": "Polygon", "coordinates": [[[58.5202912524621, 57.105324451575164], [70.0, 61.05009607786669], [70.0, 59.46348003844796], [60.89279229682197, 42.873429214436506], [57.58588228621619, 49.40784942760555], [58.5202912524621, 57.105324451575164]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 9, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[60.89279229682197, 42.873429214436506], [70.0, 59.46348003844796], [70.0, 50.0], [61.369938280719424, 41.369938280719424], [60.89279229682197, 42.873429214436506]]]}}]}

Output: {"type": "FeatureCollection", "name": "output_gt", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 1, "yield": 2.77115452086, "margin_intervention": 1.0, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Oats", "type": "ag_plot", "id": 3, "yield": 2.54648059192, "margin_intervention": 1.0, "habitat_conversion": 1.0}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 5, "yield": 2.8164643300799996, "margin_intervention": 1.0, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 6, "yield": 1.5964614396, "margin_intervention": 1.0, "habitat_conversion": 0.5126504636800543}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 7, "yield": 0.5, "margin_intervention": 1.0, "habitat_conversion": 1.0}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 8, "yield": 2.6210248863000003, "margin_intervention": 0.33850261420732725, "habitat_conversion": 0.0}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 9, "yield": 0.5, "margin_intervention": 0.6243109933029043, "habitat_conversion": 0.21608867396003692}}]}

Your farm: input: {"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 1, "yield": 1.67695696718}, "geometry": {"type": "Polygon", "coordinates": [[[8.90957552551562, 84.07506455964806], [8.105520865922387, 83.61683046961143], [0.0, 79.99242688562524], [0.0, 90.0], [2.749186944815412, 91.37459347240771], [8.90957552551562, 84.07506455964806]]]}}, {"type": "Feature", "properties": {"label": "Oats", "type": "ag_plot", "id": 2, "yield": 1.5883539304}, "geometry": {"type": "Polygon", "coordinates": [[[8.90957552551562, 84.07506455964806], [12.229203074472766, 84.61171368174838], [17.290987562336323, 72.10571595817908], [16.745248694721056, 70.31799645671629], [7.849909722983904, 72.78947369129146], [8.105520865922387, 83.61683046961143], [8.90957552551562, 84.07506455964806]]]}}, {"type": "Feature", "properties": {"label": "Exposed land/barren", "type": "hab_plots", "id": 3, "yield": 2.4317488845399997}, "geometry": {"type": "Polygon", "coordinates": [[[14.107654797418384, 87.02808519771993], [12.229203074472766, 84.61171368174838], [8.90957552551562, 84.07506455964806], [2.749186944815412, 91.37459347240771], [13.35051900190549, 96.67525950095275], [14.107654797418384, 87.02808519771993]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 4, "yield": 2.5250394100899998}, "geometry": {"type": "Polygon", "coordinates": [[[12.229203074472766, 84.61171368174838], [14.107654797418384, 87.02808519771993], [29.47211809044523, 86.84277415114978], [31.49965738121914, 79.08069323790843], [17.290987562336323, 72.10571595817908], [12.229203074472766, 84.61171368174838]]]}}, {"type": "Feature", "properties": {"label": "Spring wheat", "type": "ag_plot", "id": 5, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[7.849909722983904, 72.78947369129146], [16.745248694721056, 70.31799645671629], [16.734689480744482, 65.0], [0.0, 65.0], [0.0, 72.60768743558653], [7.849909722983904, 72.78947369129146]]]}}, {"type": "Feature", "properties": {"label": "Corn", "type": "ag_plot", "id": 6, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[8.105520865922387, 83.61683046961143], [7.849909722983904, 72.78947369129146], [0.0, 72.60768743558653], [0.0, 79.99242688562524], [8.105520865922387, 83.61683046961143]]]}}, {"type": "Feature", "properties": {"label": "Soybeans", "type": "ag_plot", "id": 7, "yield": 2.5250394100899998}, "geometry": {"type": "Polygon", "coordinates": [[[16.745248694721056, 70.31799645671629], [17.290987562336323, 72.10571595817908], [31.49965738121914, 79.08069323790843], [45.32116728755417, 66.77372242918473], [40.0, 65.0], [16.734689480744482, 65.0], [16.745248694721056, 70.31799645671629]]]}}, {"type": "Feature", "properties": {"label": "Canola/rapeseed", "type": "ag_plot", "id": 8, "yield": 0.5}, "geometry": {"type": "Polygon", "coordinates": [[[29.47211809044523, 86.84277415114978], [14.107654797418384, 87.02808519771993], [13.35051900190549, 96.67525950095275], [20.0, 100.0], [35.22017861470215, 100.0], [29.47211809044523, 86.84277415114978]]]}}, {"type": "Feature", "properties": {"label": "Grassland", "type": "hab_plots", "id": 9, "yield": 1.39116522778}, "geometry": {"type": "Polygon", "coordinates": [[[31.49965738121914, 79.08069323790843], [29.47211809044523, 86.84277415114978], [35.22017861470215, 100.0], [45.0, 100.0], [55.0, 95.0], [55.0, 70.0], [45.32116728755417, 66.77372242918473], [31.49965738121914, 79.08069323790843]]]}}]}

Final Instructions: I want you to infer the logic from the examples and work through the inferred logic to predict interventions. Give me your best estimate as to what fraction of which intervention should be done at each agricultural plot. Proceed based on the conceptual framework inferred from provided examples. Do not hallucinate. Come up with heuristics. Don't provide the full json but rather provide the python code to produce the json using the decided heuristics. Explain your reasoning and think step by step before providing the code. Handle all the features, i.e., plot ids. Don't create new variable names. Use margin_intervention and habitat_conversion for predicted values in the output. In the code no need to define the input json again, just load it from the file input.geojson.Save outputs to output.geojson. 

These are the crop prices in USD/Tonne: {'Soybeans': 370, 'Oats': 95, 'Corn': 190, 'Canola/rapeseed': 1100, 'Barley': 120, 'Spring wheat': 200}, and these are the costs (implementation costs one time and in USD/ha, and maintenance costs in USD/ha/year) : {'margin': {'implementation': 400,  'maintenance': 60}, 'habitat': {'implementation': 300, 'maintenance': 70}, 'agriculture': {'maintenance': 100}}